Skip to content

zero all new memory from allocations#876

Merged
tridge merged 1 commit intoRsyncProject:masterfrom
tridge:pr-alloc-zero
Apr 22, 2026
Merged

zero all new memory from allocations#876
tridge merged 1 commit intoRsyncProject:masterfrom
tridge:pr-alloc-zero

Conversation

@tridge
Copy link
Copy Markdown
Member

@tridge tridge commented Apr 22, 2026

Change my_alloc() to use calloc instead of malloc so all fresh allocations return zeroed memory. Also zero the expanded portion in expand_item_list() after realloc, since it knows both old and new sizes. This gives more predictable behaviour in case of bugs where uninitialised or stale memory is accidentally accessed.

Change my_alloc() to use calloc instead of malloc so all fresh
allocations return zeroed memory. Also zero the expanded portion
in expand_item_list() after realloc, since it knows both old and
new sizes. This gives more predictable behaviour in case of bugs
where uninitialised or stale memory is accidentally accessed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tridge tridge merged commit d046525 into RsyncProject:master Apr 22, 2026
5 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