svn commit: r198646 - in stable/8/sys: . amd64/include/xen
cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
dev/usb dev/xen/xenpci
Andrew Thompson
thompsa at FreeBSD.org
Thu Oct 29 23:18:27 UTC 2009
Author: thompsa
Date: Thu Oct 29 23:18:27 2009
New Revision: 198646
URL: http://svn.freebsd.org/changeset/base/198646
Log:
MFC r197561
Correct buffer sizes used so that they match. The old code could give the
impression that a overflow situation existed but was not possible.
Modified:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/usb/usb_device.c
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/dev/usb/usb_device.c
==============================================================================
--- stable/8/sys/dev/usb/usb_device.c Thu Oct 29 23:17:54 2009 (r198645)
+++ stable/8/sys/dev/usb/usb_device.c Thu Oct 29 23:18:27 2009 (r198646)
@@ -2355,6 +2355,7 @@ usb_notify_addq(const char *type, struct
{
char *data = NULL;
struct malloc_type *mt;
+ const size_t buf_size = 512;
mtx_lock(&malloc_mtx);
mt = malloc_desc2type("bus"); /* XXX M_BUS */
@@ -2362,12 +2363,12 @@ usb_notify_addq(const char *type, struct
if (mt == NULL)
return;
- data = malloc(512, mt, M_NOWAIT);
+ data = malloc(buf_size, mt, M_NOWAIT);
if (data == NULL)
return;
/* String it all together. */
- snprintf(data, 1024,
+ snprintf(data, buf_size,
"%s"
"%s "
"vendor=0x%04x "
More information about the svn-src-all
mailing list