Commit bf988c16 authored by John de la Garza's avatar John de la Garza Committed by Greg Kroah-Hartman

usbip:usbip_common.c: check return value of sscanf

Added code to check return value of sscanf.
Signed-off-by: default avatarJohn de la Garza <john@jjdev.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d2b7f4c4
......@@ -55,7 +55,8 @@ static ssize_t usbip_debug_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{
sscanf(buf, "%lx", &usbip_debug_flag);
if (sscanf(buf, "%lx", &usbip_debug_flag) != 1)
return -EINVAL;
return count;
}
DEVICE_ATTR_RW(usbip_debug);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment