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

Fix errors detected by scan-build #2098

wants to merge 7 commits into
base: master


None yet
2 participants
Copy link

bagder commented Nov 20, 2017

I ran scan-build on the code and cleaned up some low hanging fruit. The automated scan-build I run uses a much older clang version and didn't catch any of these!

bagder added some commits Nov 20, 2017

Curl_llist_remove: fix potential NULL pointer deref
Fixes a scan-build warning.

@bagder bagder changed the title Bagder/scan build fixes Fix errors detected by scan-build Nov 20, 2017

@@ -722,7 +722,6 @@ static size_t readback_bytes(mime_state *state,
sz = numbytes - state->offset;

if(numbytes > state->offset) {
sz = numbytes - state->offset;

This comment has been minimized.


jay Nov 20, 2017


I don't see how this one is right. sz is used later on

This comment has been minimized.


jay Nov 20, 2017


nm I see it now, it was set above. it would probably be easier to understand if it was set here and the one above removed

This comment has been minimized.


bagder Nov 21, 2017

Author Member

Yeah probably, was more thinking that it could benefit of being set unconditionally first so that one wouldn't think it risked ending up not being set...

@bagder bagder closed this in 9554c3c Nov 21, 2017

@bagder bagder deleted the bagder/scan-build-fixes branch Nov 21, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 14, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.