[PATCH] sanity check audit_buffer
authorAmy Griffis <amy.griffis@hp.com>
Thu, 7 Sep 2006 21:03:02 +0000 (17:03 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 11 Sep 2006 17:32:17 +0000 (13:32 -0400)
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>
kernel/audit.c

index 0a36091ed712c069f49ac2b7c02a53ddb14cf929..963fd15c9621cb9bf3764c53ee6a17d9bb343156 100644 (file)
@@ -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);
@@ -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);