Skip to content

Commit

Permalink
[PATCH] sanity check audit_buffer
Browse files Browse the repository at this point in the history
Add sanity checks for NULL audit_buffer consistent with other
audit_log* routines.

Signed-off-by: Amy Griffis <amy.griffis@hp.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Amy Griffis authored and Al Viro committed Sep 11, 2006
1 parent 3b33ac3 commit 8ef2d30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,9 @@ void audit_log_hex(struct audit_buffer *ab, const unsigned char *buf,
struct sk_buff *skb;
static const unsigned char *hex = "0123456789ABCDEF";

if (!ab)
return;

BUG_ON(!ab->skb);
skb = ab->skb;
avail = skb_tailroom(skb);
Expand Down Expand Up @@ -1060,6 +1063,9 @@ static void audit_log_n_string(struct audit_buffer *ab, size_t slen,
unsigned char *ptr;
struct sk_buff *skb;

if (!ab)
return;

BUG_ON(!ab->skb);
skb = ab->skb;
avail = skb_tailroom(skb);
Expand Down

0 comments on commit 8ef2d30

Please sign in to comment.