diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-08-01 05:36:50 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-08-01 05:36:50 +0000 |
commit | 2e4c19f779ce48faaf5abcaa186def74956a6981 (patch) | |
tree | 2a7d441b21de326c5a27b994bce0b47dcb3dd0e7 /sys/dev/usb/uaudio.c | |
parent | 0fd85d9caed3489931a1fa9c2b7520960293653d (diff) |
Don't keep the devinfo string on the stack, instead use malloc/free.
This should cure some rare stack overflows.
From augustss NetBSD
ok dlg@ pascoe@
Diffstat (limited to 'sys/dev/usb/uaudio.c')
-rw-r--r-- | sys/dev/usb/uaudio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index e2837ea2544..15bc4a7a5c7 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uaudio.c,v 1.21 2004/10/18 11:26:52 deraadt Exp $ */ +/* $OpenBSD: uaudio.c,v 1.22 2005/08/01 05:36:48 brad Exp $ */ /* $NetBSD: uaudio.c,v 1.67 2003/05/03 18:11:41 wiz Exp $ */ /* @@ -360,12 +360,13 @@ USB_ATTACH(uaudio) USB_ATTACH_START(uaudio, sc, uaa); usb_interface_descriptor_t *id; usb_config_descriptor_t *cdesc; - char devinfo[1024]; + char *devinfop; usbd_status err; int i, j, found; - usbd_devinfo(uaa->device, 0, devinfo, sizeof devinfo); - printf(": %s\n", devinfo); + devinfop = usbd_devinfo_alloc(uaa->device, 0); + printf(": %s\n", devinfop); + usbd_devinfo_free(devinfop); sc->sc_udev = uaa->device; |