Skip to content

tool_msgs: avoid null pointer deref for early errors - #20967

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/early-error
Closed

bagder wants to merge 1 commit into
masterfrom
bagder/early-error

Conversation

@bagder

@bagder bagder commented Mar 17, 2026

Copy link
Copy Markdown
Member

When errorf()/warnf() is used early on, before the global pointer is setup, curl would previosly deref the null pointer.

Follow-up to 3b40128

Found by Codex Security

When errorf()/warnf() is used early on, before the global pointer is
setup, curl would previosly deref the null pointer.

Follow-up to 3b40128

Found by Codex Security
@bagder

bagder commented Mar 18, 2026

Copy link
Copy Markdown
Member Author

augment review

@bagder
bagder marked this pull request as ready for review March 18, 2026 09:27
@augmentcode

augmentcode Bot commented Mar 18, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Prevents early calls to warnf()/errorf() from dereferencing an uninitialized global pointer.
Changes: Adds null-guards around accesses to global->tracetype, global->silent, and global->showerror so message output remains safe before global configuration is set up.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@bagder bagder closed this in acb4fcb Mar 18, 2026
@bagder
bagder deleted the bagder/early-error branch March 18, 2026 09:40
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
When errorf()/warnf() is used early on, before the global pointer is
setup, curl would previosly deref the null pointer.

Follow-up to 3b40128

Found by Codex Security

Closes curl#20967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant