diff options
author | John de la Garza <john@jjdev.com> | 2014-03-06 15:51:59 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-06 17:31:44 -0800 |
commit | bf988c16a3d65c853bd3eb0ec4f15a88a76a3ccd (patch) | |
tree | 5679c5db55364253dd9fc5cd7c82ef958db92029 /drivers/staging/usbip | |
parent | d2b7f4c4293ac16d33f4da5c8e9beb6427239285 (diff) | |
download | lwn-bf988c16a3d65c853bd3eb0ec4f15a88a76a3ccd.tar.gz lwn-bf988c16a3d65c853bd3eb0ec4f15a88a76a3ccd.zip |
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>
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r-- | drivers/staging/usbip/usbip_common.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c index 4a2aab16b10c..2a11233d44f8 100644 --- a/drivers/staging/usbip/usbip_common.c +++ b/drivers/staging/usbip/usbip_common.c @@ -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); |