aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/audit.c4
1 files changed, 3 insertions, 1 deletions
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,
708{ 708{
709 int len, avail; 709 int len, avail;
710 struct sk_buff *skb; 710 struct sk_buff *skb;
711 va_list args2;
711 712
712 if (!ab) 713 if (!ab)
713 return; 714 return;
@@ -720,6 +721,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
720 if (!avail) 721 if (!avail)
721 goto out; 722 goto out;
722 } 723 }
724 va_copy(args2, args);
723 len = vsnprintf(skb->tail, avail, fmt, args); 725 len = vsnprintf(skb->tail, avail, fmt, args);
724 if (len >= avail) { 726 if (len >= avail) {
725 /* The printk buffer is 1024 bytes long, so if we get 727 /* 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,
728 avail = audit_expand(ab, 1+len-avail); 730 avail = audit_expand(ab, 1+len-avail);
729 if (!avail) 731 if (!avail)
730 goto out; 732 goto out;
731 len = vsnprintf(skb->tail, avail, fmt, args); 733 len = vsnprintf(skb->tail, avail, fmt, args2);
732 } 734 }
733 skb_put(skb, (len < avail) ? len : avail); 735 skb_put(skb, (len < avail) ? len : avail);
734out: 736out: