[PATCH] linux-2.6.0/sound/core/misc.c - vsnprintf

From: petter wahlman
Date: Mon Dec 29 2003 - 09:21:46 EST


hi,

vsnprintf does not copy more than 'size' bytes _including_ '\0'

-p.


--- linux-2.6.0/sound/core/misc.c 2003-12-18 03:58:38.000000000
+0100
+++ linux-2.6.0-pw/sound/core/misc.c 2003-12-29 14:42:15.000000000
+0100
@@ -51,9 +51,8 @@
printk("ALSA %s:%d: ", file, line);
}
va_start(args, format);
- vsnprintf(tmpbuf, sizeof(tmpbuf)-1, format, args);
+ vsnprintf(tmpbuf, sizeof(tmpbuf), format, args);
va_end(args);
- tmpbuf[sizeof(tmpbuf)-1] = '\0';
printk(tmpbuf);
}
#endif
@@ -73,9 +72,8 @@
printk(KERN_DEBUG "ALSA %s:%d: ", file, line);
}
va_start(args, format);
- vsnprintf(tmpbuf, sizeof(tmpbuf)-1, format, args);
+ vsnprintf(tmpbuf, sizeof(tmpbuf), format, args);
va_end(args);
- tmpbuf[sizeof(tmpbuf)-1] = '\0';
printk(tmpbuf);

}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/