Skip to content

Conversation

yannaingtun
Copy link

Summary:

The current implementation lacks proper bounds checking in the write(byte[], int, int) method.
Specifically, it does not guard against integer overflow when calculating offset + length, which may result in out-of-bounds memory access and potential data corruption.

Fix:

Added validation to ensure offset and length are within safe bounds, following secure coding practices found in other hardened buffer implementations.
This prevents integer overflow and enforces correct array indexing.

Security Reference:

CWE-190: Integer Overflow or Wraparound

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.

1 participant