Skip to content

bindings/go: bound optional npoints in P{12}sToAffine and P{12}AffinesAdd - #307

Closed
arib06 wants to merge 1 commit into
supranational:masterfrom
arib06:go-npoints-bound
Closed

arib06 wants to merge 1 commit into
supranational:masterfrom
arib06:go-npoints-bound

Conversation

@arib06

@arib06 arib06 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

P1sToAffine, P2sToAffine, P1AffinesAdd and P2AffinesAdd pass the optional npoints straight to C alongside &points[0] without checking it against len(points), so an npoints past the slice end (or a negative one, which wraps to SIZE_MAX) makes blst_p{12}s_to_affine/blst_p{12}s_add read and dereference pointers beyond the slice; reject it with the same "npoints mismatch" panic P{12}s.ToAffine already uses.

@dot-asm dot-asm closed this in 9fc156b Oct 30, 2026
@dot-asm

dot-asm commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

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.

2 participants