summaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-10 18:58:51 +0100
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-10 18:58:51 +0100
commiteecb0a7338ef6504aa49def4dde6429853025801 (patch)
tree078561cbf3e1fb3d8f837a96f2a6d49d85c6819a /kernel/audit.c
parente3b926b4c1499ba7b1b9513aa6113944d572aba5 (diff)
downloadop-kernel-dev-eecb0a7338ef6504aa49def4dde6429853025801.zip
op-kernel-dev-eecb0a7338ef6504aa49def4dde6429853025801.tar.gz
AUDIT: Fix abuse of va_args.
We're not allowed to use args twice; we need to use va_copy. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 1dd456c..ddb69a4 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -708,6 +708,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
{
int len, avail;
struct sk_buff *skb;
+ va_list args2;
if (!ab)
return;
@@ -720,6 +721,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
if (!avail)
goto out;
}
+ va_copy(args2, args);
len = vsnprintf(skb->tail, avail, fmt, args);
if (len >= avail) {
/* The printk buffer is 1024 bytes long, so if we get
@@ -728,7 +730,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
avail = audit_expand(ab, 1+len-avail);
if (!avail)
goto out;
- len = vsnprintf(skb->tail, avail, fmt, args);
+ len = vsnprintf(skb->tail, avail, fmt, args2);
}
skb_put(skb, (len < avail) ? len : avail);
out:
OpenPOWER on IntegriCloud