Skip to content

ecc/bls12381: check input length for infinity encoding in SetBytes. - #618

Merged
bwesterb merged 1 commit into
mainfrom
bas/zkao5
Jun 5, 2026
Merged

ecc/bls12381: check input length for infinity encoding in SetBytes.#618
bwesterb merged 1 commit into
mainfrom
bas/zkao5

Conversation

@bwesterb

@bwesterb bwesterb commented Jun 2, 2026

Copy link
Copy Markdown
Member

The initial length check only guarantees the compressed size, so an uncompressed-infinity prefix could cause SetBytes to slice b[1:l] beyond the buffer and panic. Validate len(b) >= l before slicing.


Open in Devin Review

The initial length check only guarantees the compressed size, so an
uncompressed-infinity prefix could cause SetBytes to slice b[1:l] beyond
the buffer and panic. Validate len(b) >= l before slicing.

@thibmeu thibmeu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth having a negative test? this is straightforward and kgood so aspproving anyway

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@bwesterb
bwesterb merged commit 03204f3 into main Jun 5, 2026
14 checks passed
@bwesterb
bwesterb deleted the bas/zkao5 branch June 5, 2026 06:19
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.

3 participants