Skip to content

Conversation

kafka1991
Copy link
Collaborator

  1. array support
  2. protocol version option, binary protocol for doubles

1. array support
2. protocol version option, binary protocol for doubles
@kafka1991
Copy link
Collaborator Author

kafka1991 commented Aug 20, 2025

Hi @sklarsa
Can you take a review when you have time ?

@kafka1991
Copy link
Collaborator Author

kafka1991 commented Aug 21, 2025

@puzpuzpuz Thanks for your review!
Do you know how should we trigger the CI check?

}

totalElements := product(shape)
if totalElements > MaxArrayElements {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we check the product for overflow?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Example Attack:
// On 64-bit: uint max = 18,446,744,073,709,551,615
shape := []uint{4294967296, 4294967296} // Each within bounds individually
// product = 4294967296 * 4294967296 = 18446744073709551616 → OVERFLOWS to 0
// Bypasses MaxArrayElements check!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in 99d1a6c

@puzpuzpuz
Copy link
Collaborator

Do you know how should we trigger the CI check?

I've asked if someone can configure that on this repo - I don't have the permissions.

buffer.go Outdated
if dim1 > 0 {
dim2 = len(values[0])
totalElements := dim1 * dim2
if dim1 > MaxArrayElements || dim2 > MaxArrayElements || totalElements > MaxArrayElements || totalElements < 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to improve overflow detection:
dim1 = 65536, dim2 = 65536
totalElements = 65536 * 65536 = 4294967296
On 32-bit systems: overflows to 0, bypasses validation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in 99d1a6c

@puzpuzpuz
Copy link
Collaborator

@kafka1991 Vlad copied settings from the core repo to this one, but I still don't see the Approve and run CI button. Maybe a new commit needs to be pushed into your branch to have GH reevaluate the settings?

@kafka1991
Copy link
Collaborator Author

@kafka1991 Vlad copied settings from the core repo to this one, but I still don't see the Approve and run CI button. Maybe a new commit needs to be pushed into your branch to have GH reevaluate the settings?

The CI checks still haven't started. Maybe I should push to branch in the repo and reopen the PR.

@puzpuzpuz
Copy link
Collaborator

The CI checks still haven't started. Maybe I should push to branch in the repo and reopen the PR.

@kafka1991 if you have the permissions now, let's do this.

@kafka1991 kafka1991 closed this Aug 24, 2025
@kafka1991
Copy link
Collaborator Author

Continue in a separate PR #55

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