Repository navigation
Conversation
--stop-after parsed its argument with atol(arg) * 60, so values with units or decimals like --stop-after=2h or --stop-after=1.5 silently ran for 2 or 1 minutes instead of failing (unlike --timeout=2h). Multiplying by 60 before bounds checks also hit signed integer overflow on large values and let wrapped values like 307445734561825861 pass as a small positive offset on 64-bit long. Parse the argument with strtol(), reject empty values and trailing characters, and check val > LONG_MAX / 60 before multiplying by 60. Add regression cases to testsuite/tests/transfer/stop-time.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--stop-after=2hsilently runs for 2 minutes and--stop-after=1.5runs for 1, while--timeout=2hfails with an error.Large values also overflow
longbefore the bounds check (307445734561825861wraps to 44s on 64-bitlong).I fixed both in
--stop-afterand added cases tostop-time.py.