mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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>
This commit is contained in:
parent
e3b926b4c1
commit
eecb0a7338
1 changed files with 3 additions and 1 deletions
|
@ -708,6 +708,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
||||||
{
|
{
|
||||||
int len, avail;
|
int len, avail;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
va_list args2;
|
||||||
|
|
||||||
if (!ab)
|
if (!ab)
|
||||||
return;
|
return;
|
||||||
|
@ -720,6 +721,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
||||||
if (!avail)
|
if (!avail)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
va_copy(args2, args);
|
||||||
len = vsnprintf(skb->tail, avail, fmt, args);
|
len = vsnprintf(skb->tail, avail, fmt, args);
|
||||||
if (len >= avail) {
|
if (len >= avail) {
|
||||||
/* The printk buffer is 1024 bytes long, so if we get
|
/* 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);
|
avail = audit_expand(ab, 1+len-avail);
|
||||||
if (!avail)
|
if (!avail)
|
||||||
goto out;
|
goto out;
|
||||||
len = vsnprintf(skb->tail, avail, fmt, args);
|
len = vsnprintf(skb->tail, avail, fmt, args2);
|
||||||
}
|
}
|
||||||
skb_put(skb, (len < avail) ? len : avail);
|
skb_put(skb, (len < avail) ? len : avail);
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in a new issue