Skip to content

fix: pass std::string to Poco::format for %s args - #500

Merged
lanthora merged 1 commit into
masterfrom
fix/strerror-std-string
Aug 6, 2026
Merged

lanthora merged 1 commit into
masterfrom
fix/strerror-std-string

Conversation

@lanthora

@lanthora lanthora commented Aug 6, 2026

Copy link
Copy Markdown
Owner

strerror returns a transient char* pointing to a static buffer that can be overwritten by subsequent calls; pass std::string(strerror(...)) to Poco::format so %s formats a stable copy.

Poco::format with %s can misbehave on transient C string pointers and
arrays that may be overwritten; pass std::string copies instead. Applies
to error/status logs in the linux and macos tun implementations.
@lanthora
lanthora force-pushed the fix/strerror-std-string branch from f699259 to 13cbebf Compare August 6, 2026 12:00
@lanthora lanthora changed the title fix: wrap strerror with std::string for Poco::format %s fix: pass std::string to Poco::format for %s args Aug 6, 2026
@lanthora
lanthora marked this pull request as ready for review August 6, 2026 12:06
@lanthora
lanthora merged commit 78bd3d7 into master Aug 6, 2026
4 checks passed
@lanthora
lanthora deleted the fix/strerror-std-string branch August 6, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant