mirror of
https://github.com/troglobit/finit.git
synced 2026-10-20 11:19:35 +00:00
Defensive programming, check bounds of loop variable first
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
fe017642de
commit
338c358a75
1 file changed
+1
-1
+1
-1
@@ -170,7 +170,7 @@ char *sanitize(char *arg, size_t len)
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
while (isallowed(arg[i]) && i < len)
|
||||
while (i < len && isallowed(arg[i]))
|
||||
i++;
|
||||
|
||||
if (i + 1 < len) {
|
||||
|
||||
Reference in new issue
Block a user