Skip to content
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

formdata: avoid "Argument cannot be negative" warning #7328

Closed
wants to merge 1 commit into from

Conversation

@bagder
Copy link
Member

@bagder bagder commented Jun 30, 2021

... when converting a curl_off_t to size_t, by using CURL_ZERO_TERMINATED before passing the argument to the function.

Detected by Coverity CID 1486590.

@bagder bagder added the tidy-up label Jun 30, 2021
@danielgustafsson

This comment has been hidden.

@bagder

This comment has been hidden.

... when converting a curl_off_t to size_t, by using
CURL_ZERO_TERMINATED before passing the argument to the function.

Detected by Coverity CID 1486590.

Closes #7328
@bagder bagder force-pushed the bagder/formdata-neg-clen branch from f462d9f to 87217e1 Jul 1, 2021
@bagder bagder changed the title formdata: remove incorrect logic for handling zero length data formdata: avoid "Argument cannot be negative" warning Jul 1, 2021
Copy link
Member

@danielgustafsson danielgustafsson left a comment

Aha! I missed the difference in parameter type last night, now I get it.

@bagder
Copy link
Member Author

@bagder bagder commented Jul 1, 2021

Yeah, the curl_off_t to size_t conversion with a negative value is what coverity (rightfully I think) complains about.

@bagder bagder closed this in e081048 Jul 1, 2021
@bagder bagder deleted the bagder/formdata-neg-clen branch Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants