From: Amy Griffis Date: Thu, 7 Sep 2006 21:03:02 +0000 (-0400) Subject: [PATCH] sanity check audit_buffer X-Git-Tag: v2.6.18-rc7~7^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ef2d3040e5cf38f7d64a408038f576b4a5ec987;p=linux-2.6 [PATCH] sanity check audit_buffer Add sanity checks for NULL audit_buffer consistent with other audit_log* routines. Signed-off-by: Amy Griffis Signed-off-by: Al Viro --- diff --git a/kernel/audit.c b/kernel/audit.c index 0a36091ed7..963fd15c96 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -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);