Skip to content

Commit

Permalink
isdn: prevent NULL ptr Oops in capi_cmsg2str()
Browse files Browse the repository at this point in the history
The dereferencing of the private pointer cmsg->m in capi_cmsg2str() may
cause an Oops in case of an error, which is particularly inconvenient
as that function is typically used to format an error message. Add a
NULL pointer check to avoid this.

Impact: error handling improvement
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tilman Schmidt authored and David S. Miller committed Jun 8, 2009
1 parent 4793d15 commit 7d31acd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/isdn/capi/capiutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,8 @@ _cdebbuf *capi_cmsg2str(_cmsg * cmsg)
{
_cdebbuf *cdb;

if (!cmsg->m)
return NULL; /* no message */
cdb = cdebbuf_alloc();
if (!cdb)
return NULL;
Expand Down

0 comments on commit 7d31acd

Please sign in to comment.