lkml.org 
[lkml]   [2010]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] auditing: Always follow va_copy() with va_end()
    Hi,

    A call to va_copy() should always be followed by a call to va_end() in the
    same function. In kernel/autit.c::audit_log_vformat() this is not always
    done. This patch makes sure va_end() is always called.

    Signed-off-by: Jesper Juhl <jj@chaosbits.net>
    ---
    audit.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/kernel/audit.c b/kernel/audit.c
    index 77770a0..d86027c 100644
    --- a/kernel/audit.c
    +++ b/kernel/audit.c
    @@ -1255,12 +1255,13 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
    avail = audit_expand(ab,
    max_t(unsigned, AUDIT_BUFSIZ, 1+len-avail));
    if (!avail)
    - goto out;
    + goto out_va_end;
    len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2);
    }
    - va_end(args2);
    if (len > 0)
    skb_put(skb, len);
    +out_va_end:
    + va_end(args2);
    out:
    return;
    }


    --
    Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
    Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
    Plain text mails only, please.



    \
     
     \ /
      Last update: 2010-12-24 19:37    [W:0.055 / U:0.188 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site