Skip to content

Prevent undefined behavior in Windows vasprintf#2630

Open
metsw24-max wants to merge 1 commit intofacebook:mainfrom
metsw24-max:vasprintf-va-list-handling-windows
Open

Prevent undefined behavior in Windows vasprintf#2630
metsw24-max wants to merge 1 commit intofacebook:mainfrom
metsw24-max:vasprintf-va-list-handling-windows

Conversation

@metsw24-max
Copy link
Copy Markdown
Contributor

The Windows vasprintf implementation reused a consumed va_list across two vsnprintf calls, which is invalid and can produce incorrect output or crashes. Use va_copy for each call to ensure correct behavior.

Also avoid assigning to *dest before success to prevent returning a pointer on failure.

@meta-cla meta-cla bot added the CLA Signed label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant