> -----Original Message----- > From: [email protected] [mailto:linux-usb- > [email protected]] On Behalf Of [email protected] > Sent: Saturday, May 24, 2014 7:29 PM > To: [email protected]; [email protected] > Subject: [PATCH v3 2/4] libusbg: Fix buffer overrun issue. > CID#56128 > > From: Philippe De Swert <[email protected]> > > Avoid calling usbg_read_string() with a 40 byte long buffer, which > in turn is filled in > by usbg_read_buf() which uses a maximum of 256 bytes > (USBG_MAX_STR_LENGTH). This adjusts > the buffer to be the right size. > > Signed-off-by: Philippe De Swert <[email protected]>
Reviewed-by: Krzysztof Opasiak <[email protected]> > --- > src/usbg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/usbg.c b/src/usbg.c > index 5d9c083..66aa435 100644 > --- a/src/usbg.c > +++ b/src/usbg.c > @@ -681,7 +681,7 @@ static int > usbg_parse_function_net_attrs(usbg_function *f, > usbg_function_attrs *f_attrs) > { > struct ether_addr *addr; > - char str_addr[40]; > + char str_addr[USBG_MAX_STR_LENGTH]; > int ret; > > ret = usbg_read_string(f->path, f->name, "dev_addr", > str_addr); > -- > 1.8.1.2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux- > usb" in > the body of a message to [email protected] > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
