From: David Woodhouse Date: Tue, 10 May 2005 17:58:51 +0000 (+0100) Subject: AUDIT: Fix abuse of va_args. X-Git-Tag: firefly_0821_release~41094^2~69 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eecb0a7338ef6504aa49def4dde6429853025801;p=firefly-linux-kernel-4.4.55.git 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 --- diff --git a/kernel/audit.c b/kernel/audit.c index 1dd456c90ae5..ddb69a458203 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: