Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buffer overflow for non-batched send when the message metadata size exceeds 64KB #443

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

BewareMyPower
Copy link
Contributor

See apache/pulsar-client-python#223

Motivation

Currently a shared buffer is used to store serialized message metadata for each send request. However, its capacity is only 64KB, when the metadata size exceeds 64KB, buffer overflow could happen.

Modifications

When the metadata size is too large, allocate a new buffer instead of using the shared buffer. Add testLargeProperties to cover it.

…ze exceeds 64KB

See apache/pulsar-client-python#223

### Motivation

Currently a shared buffer is used to store serialized message metadata
for each send request. However, its capacity is only 64KB, when the metadata
size exceeds 64KB, buffer overflow could happen.

### Modifications

When the metadata size is too large, allocate a new buffer instead of
using the shared buffer. Add `testLargeProperties` to cover it.
@BewareMyPower BewareMyPower self-assigned this Aug 29, 2024
@BewareMyPower BewareMyPower added the bug Something isn't working label Aug 29, 2024
@BewareMyPower BewareMyPower added this to the 3.6.0 milestone Aug 29, 2024
@shibd shibd merged commit 8f269e8 into apache:main Aug 29, 2024
15 checks passed
shibd pushed a commit that referenced this pull request Aug 29, 2024
…ze exceeds 64KB (#443)

See apache/pulsar-client-python#223

### Motivation

Currently a shared buffer is used to store serialized message metadata
for each send request. However, its capacity is only 64KB, when the metadata
size exceeds 64KB, buffer overflow could happen.

### Modifications

When the metadata size is too large, allocate a new buffer instead of
using the shared buffer. Add `testLargeProperties` to cover it.

(cherry picked from commit 8f269e8)
@BewareMyPower BewareMyPower deleted the bewaremypower/property-size-limit branch August 29, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants