WSL2-Linux-Kernel/tools/usb/usbip/libsrc
Colin Ian King e325808c00 usbip: tools: fix atoi() on non-null terminated string
Currently the call to atoi is being passed a single char string
that is not null terminated, so there is a potential read overrun
along the stack when parsing for an integer value.  Fix this by
instead using a 2 char string that is initialized to all zeros
to ensure that a 1 char read into the string is always terminated
with a \0.

Detected by cppcheck:
"Invalid atoi() argument nr 1. A nul-terminated string is required."

Fixes: 3391ba0e27 ("usbip: tools: Extract generic code to be shared with vudc backend")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-18 19:44:39 +02:00
..
Makefile.am License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
list.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
names.c usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
names.h usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
sysfs_utils.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysfs_utils.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
usbip_common.c usbip: tools: add more error codes for usbip request/reply messages 2018-03-09 09:17:08 -08:00
usbip_common.h usbip: tools: add more error codes for usbip request/reply messages 2018-03-09 09:17:08 -08:00
usbip_device_driver.c tools: usb: usbip: fix fd leak in case of 'fread' failure 2018-01-04 17:05:55 +01:00
usbip_device_driver.h usbip: tools: Add vudc backend to usbip tools 2016-04-26 15:19:50 -07:00
usbip_host_common.c usbip: tools: fix atoi() on non-null terminated string 2018-10-18 19:44:39 +02:00
usbip_host_common.h usbip: tools: Extract generic code to be shared with vudc backend 2016-04-26 15:19:50 -07:00
usbip_host_driver.c usbip: tools: Extract generic code to be shared with vudc backend 2016-04-26 15:19:50 -07:00
usbip_host_driver.h usbip: tools: Extract generic code to be shared with vudc backend 2016-04-26 15:19:50 -07:00
vhci_driver.c usbip: fix vhci_hcd controller counting 2018-10-02 12:05:29 -07:00
vhci_driver.h usbip: dynamically allocate idev by nports found in sysfs 2018-05-31 12:43:14 +02:00