From: Keith Packard Date: Sun, 14 Aug 2011 01:33:07 +0000 (-0700) Subject: libaltos: Mis-allocated device list in libaltos X-Git-Tag: 0.9.6.0~23 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=313d740b5284b24f1cc7a1ba5779136b55d49ebe libaltos: Mis-allocated device list in libaltos Would overrun mis-allocated array, causing chaos. Signed-off-by: Keith Packard --- diff --git a/altosui/libaltos/libaltos.c b/altosui/libaltos/libaltos.c index 00a75de9..f2c8bd8d 100644 --- a/altosui/libaltos/libaltos.c +++ b/altosui/libaltos/libaltos.c @@ -559,7 +559,7 @@ altos_list_start(void) if (USB_IS_ALTUSMETRUM(dev->idVendor, dev->idProduct)) { if (devs->dev) devs->dev = realloc(devs->dev, - devs->ndev + 1 * sizeof (struct usbdev *)); + (devs->ndev + 1) * sizeof (struct usbdev *)); else devs->dev = malloc (sizeof (struct usbdev *)); devs->dev[devs->ndev++] = dev;