Skip to content

Return NULL when hash context allocation fails - #326

Merged
rhash merged 2 commits into
rhash:masterfrom
dajiaohuang:fix-audit-316-init-allocation
Oct 19, 2026
Merged

rhash merged 2 commits into
rhash:masterfrom
dajiaohuang:fix-audit-316-init-allocation

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Fixes #316.

rhash_init_multi now returns NULL when context allocation fails instead of taking the address of a member through a NULL pointer.

Validation: a test preload injects failure into aligned allocation. The base build reports the UBSan null-member access; this build returns NULL without a report (Linux/GCC 13.3). Regression: tests/test_init_alloc_failure.py.

@rhash
rhash merged commit 0517ba2 into rhash:master Oct 19, 2026
3 checks passed
@rhash

rhash commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Accepted the fix in the librhash/rhash.c file.

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.

Return NULL when rhash_init_multi allocation fails

2 participants