aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmy Griffis <amy.griffis@hp.com>2006-09-07 17:03:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2006-09-11 13:32:17 -0400
commit8ef2d3040e5cf38f7d64a408038f576b4a5ec987 (patch)
treedef11d400d2262e104cb1c64a953276794d8c9a8
parent3b33ac3182a4554742757a0c61ee1df162cf8225 (diff)
[PATCH] sanity check audit_buffer
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>
-rw-r--r--kernel/audit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 0a36091ed71..963fd15c962 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);