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

connect: fix access of pointer before NULL check #10284

Closed
wants to merge 1 commit into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Jan 12, 2023

Detected by Coverity CID 1518992

Detected by Coverity CID 1518992
@bagder bagder added the tidy-up label Jan 12, 2023
@bagder bagder requested a review from icing January 12, 2023 13:39
Copy link
Contributor

@icing icing left a comment

Choose a reason for hiding this comment

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

nice catch!

@@ -677,7 +677,9 @@ static CURLcode is_connected(struct Curl_cfilter *cf,
for(i = 0; i < sizeof(ctx->baller)/sizeof(ctx->baller[0]); i++) {
struct eyeballer *baller = ctx->baller[i];
DEBUGF(LOG_CF(data, cf, "%s assess started=%d, result=%d",
baller->name, baller->has_started, baller->result));
baller?baller->name:NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems wise and necessary, yes.

@bagder bagder closed this in 8956cd4 Jan 12, 2023
@bagder bagder deleted the bagder/connect-baller branch January 12, 2023 14:32
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
Detected by Coverity CID 1518992

Closes curl#10284
vszakats added a commit to vszakats/curl that referenced this pull request Oct 11, 2023
vszakats added a commit that referenced this pull request Oct 13, 2023
Do not pass NULL to printf %s.

Seen with gcc 13.2.0 on Debian:
```
.../curl/lib/connect.c:696:27: warning: '%s' directive argument is null [-Wformat-overflow=]
```
Ref: https://github.com/curl/curl-for-win/actions/runs/6476161689/job/17584426483#step:3:11104

Ref: #10284
Co-authored-by: Jay Satiro
Closes #12082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants