]> asedeno.scripts.mit.edu Git - linux.git/commit
staging: rtl8723bs: ensure cmd is large enough for %4s scanf format
authorColin Ian King <colin.king@canonical.com>
Tue, 11 Apr 2017 21:21:47 +0000 (22:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Apr 2017 08:22:03 +0000 (10:22 +0200)
commit2e85ccf13a724fd6e9bdc50ffe105d68fbbb0ef5
treebd9d55b895ccef166d6ec4a066cea5f3c28b0c58
parent73bd2eaa8785df85a90212c0841541231cc8e723
staging: rtl8723bs: ensure cmd is large enough for %4s scanf format

char array cmd is being scanned in using a %4s scanf format
specifier and so cmd must be an array of 5 chars. Increase size
to 5 chars to ensure we don't have an overflow.

Detected with static analysis by cppcheck:

"(error) Width 4 given in format string (no. 1) is larger than
destination buffer 'cmd[4]', use %3s to prevent overflowing it."

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/rtw_proc.c