ia64/xen-unstable

changeset 16493:bb31c9325d5f

Fix string length check for vsnprintf() in debugtrace_printk().
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Nov 28 12:50:24 2007 +0000 (2007-11-28)
parents 43b7d24acf9c
children c76a9aa12d2e
files xen/drivers/char/console.c
line diff
     1.1 --- a/xen/drivers/char/console.c	Wed Nov 28 12:44:46 2007 +0000
     1.2 +++ b/xen/drivers/char/console.c	Wed Nov 28 12:50:24 2007 +0000
     1.3 @@ -835,7 +835,7 @@ void debugtrace_printk(const char *fmt, 
     1.4      snprintf(buf, sizeof(buf), "%u ", ++count);
     1.5  
     1.6      va_start(args, fmt);
     1.7 -    (void)vsnprintf(buf + strlen(buf), sizeof(buf), fmt, args);
     1.8 +    (void)vsnprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), fmt, args);
     1.9      va_end(args);
    1.10  
    1.11      if ( debugtrace_send_to_console )