mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-18 12:37:40 +07:00
libudev-util: check length before accesing the array
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This commit is contained in:
parent
9dfdc62113
commit
39de7639b4
@ -227,7 +227,7 @@ int util_replace_whitespace(const char *str, char *to, size_t len)
|
||||
|
||||
/* strip leading whitespace */
|
||||
i = 0;
|
||||
while (isspace(str[i]) && (i < len))
|
||||
while ((i < len) && isspace(str[i]))
|
||||
i++;
|
||||
|
||||
j = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user