Repository navigation
Conversation
Fix: TAINTED.INT_OVERFLOW Problem: Potential potential integer overflow in the block_address_time_parser() function; Solution: Adding constraint checking for ulong Signed-off-by: t.mishin@fobos-nt.ru Signed-off by: dinchik@altlinux.org
Fix: TAINTED.INT_OVERFLOW Problem: Potential potential integer overflow in the time_string_to_seconds() function; Solution: Adding constraint checking for long Signed-off-by: t.mishin@fobos-nt.ru Signed-off by: dinchik@altlinux.org
Contributor
|
Thanks. This needs 2 corrections. In common/common.c, just use 0 as the minimum. No need to support negative days. Also, parenthesize the units: LONG_MAX / (HOURS) and similarly for days/months. Otherwise it turns into (LONG_MAX / 60) * 60, rather than division by 3,600. And a follow up, ids.c uses strtoul which does accept -1 but converts it to ULONG_MAX. Probably best to just use strtol and make "i" a long then reject negative numbers there too since all supported numbers should fit in a positive long number. |
Author
|
I’ve made all the requested changes in a new PR. There were quite a few fixes needed for this one, so I decided to move the changes to a separate PR. #560 |
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.
Fix: TAINTED.INT_OVERFLOW
Problem:
Potential potential integer overflow in the block_address_time_parser() function;
Potential potential integer overflow in the time_string_to_seconds() function;
Solution:
Adding constraint checking for ulong
Solution: Adding constraint checking for long
Signed-off-by: t.mishin@fobos-nt.ru
Signed-off by: dinchik@altlinux.org