Skip to content

Commit

Permalink
parse_timeout: move overflow check to the correct location
Browse files Browse the repository at this point in the history
It was not covering all cases in its original location.
Fixes oss-fuzz issue 60454 with fuzz_sudoers.
  • Loading branch information
millert committed Jul 8, 2023
1 parent fc02df1 commit 9f7128f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/sudoers/timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 9f7128f

Please sign in to comment.