From: Philippe De Swert Date: Tue, 13 May 2014 12:58:40 +0000 (+0300) Subject: libusbgx: Fix buffer overrun issue. CID#56128 X-Git-Tag: libusbgx-v0.1.0~196 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9372e6aef58eca36e5e1127f33045eec090876a3;p=platform%2Fupstream%2Flibusbg.git libusbgx: Fix buffer overrun issue. CID#56128 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 [Port from libusbg and update description] Signed-off-by: Krzysztof Opasiak --- 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);