parse_timeout: move overflow check to the correct location
It was not covering all cases in its original location. Fixes oss-fuzz issue 60454 with fuzz_sudoers.
This commit is contained in:
@@ -94,11 +94,11 @@ parse_timeout(const char *timestr)
|
||||
l *= 60;
|
||||
break;
|
||||
}
|
||||
if (l > INT_MAX - timeout)
|
||||
goto overflow;
|
||||
}
|
||||
cp = ep;
|
||||
|
||||
if (l > INT_MAX - timeout)
|
||||
goto overflow;
|
||||
timeout += (int)l;
|
||||
} while (*cp != '\0');
|
||||
|
||||
|
Reference in New Issue
Block a user