OSDN Git Service

HID: wacom: Check for string overflow from strscpy calls
authorJason Gerecke <killertofu@gmail.com>
Fri, 14 Apr 2023 18:22:10 +0000 (11:22 -0700)
committerJiri Kosina <jkosina@suse.cz>
Tue, 23 May 2023 13:06:36 +0000 (15:06 +0200)
commitd9eef346b601afb0bd74b49e0db06f6a5cebd030
treead8e6988dc35dc91dd4e0eee4c4db0a6e1948b4a
parent34da76dca4673ab1819830b4924bb5b436325b26
HID: wacom: Check for string overflow from strscpy calls

The strscpy function is able to return an error code when a copy would
overflow the size of the destination. The copy is stopped and the buffer
terminated before overflow actually occurs so it is safe to continue
execution, but we should still produce a warning should this occur.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom_sys.c