Skip to content

hostip: init the curl_jmpenv_lock appropriately#21432

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/mutex-init
Closed

hostip: init the curl_jmpenv_lock appropriately#21432
bagder wants to merge 1 commit into
masterfrom
bagder/mutex-init

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented Apr 24, 2026

A zero-initialized static value is not guaranteed to be a valid mutex on all POSIX implementations

Spotted by Codex Security

A zero-initialized static value is not guaranteed to be a valid mutex on
all POSIX implementations

Spotted by Codex Security
@bagder bagder requested a review from Copilot April 24, 2026 06:12
@bagder bagder marked this pull request as ready for review April 24, 2026 06:12
@github-actions github-actions Bot added the name lookup DNS and related tech label Apr 24, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a portability issue in libcurl’s resolver timeout path by ensuring a global curl_simple_lock is initialized using the platform-appropriate initializer instead of relying on zero-initialization.

Changes:

  • Initialize curl_jmpenv_lock with CURL_SIMPLE_LOCK_INIT under USE_ALARM_TIMEOUT to ensure valid mutex/lock initialization on all supported platforms.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder bagder closed this in 5c75668 Apr 24, 2026
@bagder bagder deleted the bagder/mutex-init branch April 24, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

name lookup DNS and related tech

Development

Successfully merging this pull request may close these issues.

2 participants