Skip to content

servers: fix to avoid a non-signal-safe call in signal handler - #22491

Closed
vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:u-signal-safe
Closed

vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:u-signal-safe

Conversation

@vszakats

@vszakats vszakats commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

`strlen()` is only considered signal-safe since POSIX.1-2008.

Reported by Copilot
Bug: curl#22487 (review)
@vszakats vszakats added the tests label Aug 5, 2026
@vszakats vszakats changed the title servers: avoid non-signal-safe call in signal handler servers: fix to avoid a non-signal-safe call in signal handler Aug 5, 2026
@vszakats
vszakats requested a lite review from Copilot August 5, 2026 12:22

Copilot AI 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.

Pull request overview

This pull request updates the test server signal handler to avoid calling strlen() from within the handler, improving async-signal-safety on platforms where strlen() is not guaranteed signal-safe prior to POSIX.1-2008.

Changes:

  • Replace strlen(serverlogfile) in exit_signal_handler() with a manual NUL-terminated character loop that emits the path without relying on strlen().

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

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@vszakats vszakats closed this in b260e9f Aug 5, 2026
@vszakats
vszakats deleted the u-signal-safe branch August 5, 2026 13:09
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.

2 participants