mirror of
https://github.com/troglobit/finit.git
synced 2026-11-17 19:30:29 +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;
|
size_t i = 0;
|
||||||
|
|
||||||
while (isallowed(arg[i]) && i < len)
|
while (i < len && isallowed(arg[i]))
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
if (i + 1 < len) {
|
if (i + 1 < len) {
|
||||||
|
|||||||
Reference in new issue
Block a user