mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-03 15:55:38 +00:00
usbip:usbip_common.c: check return value of sscanf
Added code to check return value of sscanf. Signed-off-by: John de la Garza <john@jjdev.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d2b7f4c429
commit
bf988c16a3
1 changed files with 2 additions and 1 deletions
|
@ -55,7 +55,8 @@ static ssize_t usbip_debug_store(struct device *dev,
|
||||||
struct device_attribute *attr, const char *buf,
|
struct device_attribute *attr, const char *buf,
|
||||||
size_t count)
|
size_t count)
|
||||||
{
|
{
|
||||||
sscanf(buf, "%lx", &usbip_debug_flag);
|
if (sscanf(buf, "%lx", &usbip_debug_flag) != 1)
|
||||||
|
return -EINVAL;
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
DEVICE_ATTR_RW(usbip_debug);
|
DEVICE_ATTR_RW(usbip_debug);
|
||||||
|
|
Loading…
Add table
Reference in a new issue