Skip to content

Don't try to malloc 0 bytes in xmerge#7

Merged
ethomson merged 1 commit into
mainfrom
ethomson/xmerge_malloc_zero
May 2, 2026
Merged

Don't try to malloc 0 bytes in xmerge#7
ethomson merged 1 commit into
mainfrom
ethomson/xmerge_malloc_zero

Conversation

@ethomson
Copy link
Copy Markdown
Member

@ethomson ethomson commented May 2, 2026

For zero byte files, avoid allocation - this avoids undefined behavior around malloc(0) and potentially memcpy(..., NULL, 0).

For zero byte files, avoid allocation - this avoids undefined behavior
around malloc(0) and potentially memcpy(..., NULL, 0).
@ethomson ethomson merged commit c46ae8d into main May 2, 2026
3 checks passed
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