-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select: make Curl_socket_check take timediff_t timeout #5240
Conversation
The same condition check would need to be applied to And I am preparing a PR to make the functions in |
Sounds like a good move! I'll pause this PR then and we can close it again once your work lands. |
Then I will also hold off a fix for two |
I think we should ignore the analyzer in this case. Any compiler can optimize it away as is. |
I agree that it is a totally harmless detail, but I think this code also risk causing compiler warnings so I still think we should take care of it. |
Coverity found CID 1461718: Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms > 9223372036854775807L" is always false regardless of the values of its operands. This occurs as the logical second operand of "||".
3186b4c
to
a78bb56
Compare
I just want to add that this is meant to primarily address the problem Coverity detected before the pending release, it is not a replacement of #5262. |
Follow-up to a96c752 which changed the timeout_ms type from time_t to timediff_t. Ref: curl#5240 Closes #xxxx
Make all functions in select.[ch] take timeout_ms as timediff_t which should always be large enough and signed on all platforms to take all possible timeout values and avoid type conversions. Reviewed-by: Jay Satiro Reviewed-by: Daniel Stenberg Replaces #5107 and partially #5262 Related to #5240 and #5286 Closes #5343
Coverity found CID 1461718:
Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms >
9223372036854775807L" is always false regardless of the values of its
operands. This occurs as the logical second operand of "||".