Skip to content

Conversation

@aeu
Copy link
Contributor

@aeu aeu commented Nov 5, 2025

readlink does not null terminate the output buffer. The existing code passed the full buffer size to readlink, which did not leave any space to append a terminator.

This change passes size -1 to readlink and terminates the buffer with a '\0' after a successful read to avoid reading past the end of the buffer.

This change is consistent with the usage pattern seen in swift-foundation-icu / icuSources / common / putil.cpp

@aeu aeu requested review from al45tair and mikeash as code owners November 5, 2025 23:53
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.

2 participants