mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
fbdev: sisfb: Replace strlen() strcpy() pair with strscpy()
Use the result of strscpy() for the overflow check. Signed-off-by: David Laight <david.laight.linux@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
d1338aa2d6
commit
160b2ef00f
|
|
@ -204,8 +204,7 @@ static void sisfb_search_mode(char *name, bool quiet)
|
|||
return;
|
||||
}
|
||||
|
||||
if(strlen(name) <= 19) {
|
||||
strcpy(strbuf1, name);
|
||||
if (strscpy(strbuf1, name) > 0) {
|
||||
for(i = 0; i < strlen(strbuf1); i++) {
|
||||
if(strbuf1[i] < '0' || strbuf1[i] > '9') strbuf1[i] = ' ';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user