Skip to content

Use bounded unsigned shifts for hash masks - #328

Open
dajiaohuang wants to merge 1 commit into
rhash:masterfrom
dajiaohuang:fix-audit-318-bit-shifts
Open

dajiaohuang wants to merge 1 commit into
rhash:masterfrom
dajiaohuang:fix-audit-318-bit-shifts

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Fixes #318.

Use unsigned shift operands in mask operations and bound extended hash indices to RHASH_HASH_COUNT. The hash-check bit-length helper now rejects zero before calling ctz, avoiding an invalid shift reached by the existing missing-files case.

Validation: Linux/GCC 13.3 UBSan build; all 26 full CLI groups pass, including the missing-files case. The original UBSan report identified ctz(0) and the following oversized shift.

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.

Use unsigned values for bit-mask shifts

1 participant