Skip to content

Handle NULL connection pointer passed in by multi.c - #2653

Closed
lymanepp wants to merge 4 commits into
curl:masterfrom
lymanepp:master
Closed

lymanepp wants to merge 4 commits into
curl:masterfrom
lymanepp:master

Conversation

@lymanepp

Copy link
Copy Markdown

No description provided.

Comment thread lib/url.c Outdated

conn->bits.do_more = FALSE; /* by default there's no curl_do_more() to
use */
if (conn != NULL)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we prefer these to be just if(conn) - and notice the lack of space before the paren!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as requested.

@bagder

bagder commented Jun 12, 2018

Copy link
Copy Markdown
Member

Please explain why we want this to work like this? Are you saying we end up there without a conn pointer during some situation?

@lymanepp

Copy link
Copy Markdown
Author

This happens when using a multi handle. You can find in multi.c where this gets called with a NULL pointer.

@lymanepp

Copy link
Copy Markdown
Author

The CI build errors and coverage decrease to 0% are unrelated to these changes.

@bagder

bagder commented Jun 13, 2018

Copy link
Copy Markdown
Member

Ah right, when using HTTP/2... (when Curl_multi_add_perform() is called from http2.c)

@bagder

bagder commented Jun 13, 2018

Copy link
Copy Markdown
Member

Thanks! (I edited it slightly before I merged.)

@bagder bagder closed this in a0f9670 Jun 13, 2018
@lymanepp

Copy link
Copy Markdown
Author

Thanks badger!

@lock lock Bot locked as resolved and limited conversation to collaborators Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants