Skip to content
Commit e5dfa3f9 authored by Jonathan Dieter's avatar Jonathan Dieter Committed by Greg Kroah-Hartman
Browse files

usbip: Fix potential format overflow in userspace tools



The usbip userspace tools call sprintf()/snprintf() and don't check for
the return value which can lead the paths to overflow, truncating the
final file in the path.

More urgently, GCC 7 now warns that these aren't checked with
-Wformat-overflow, and with -Werror enabled in configure.ac, that makes
these tools unbuildable.

This patch fixes these problems by replacing sprintf() with snprintf() in
one place and adding checks for the return value of snprintf().

Reviewed-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: default avatarJonathan Dieter <jdieter@lesbg.com>
Acked-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2c93e790
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment