mirror of
https://github.com/troglobit/finit.git
synced 2026-10-10 16:52:39 +07:00
Defensive programming, check bounds of loop variable first
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+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