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.prototype.indexOf() and friends. #796

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

xeioex
Copy link
Contributor

@xeioex xeioex commented Oct 10, 2024

No description provided.

Previously, when `from` argument was provided heap-buffer-overflow might
happen due to lack of boundary check. `to = njs_min(to, length)`
statement was also removed because it has no effect, `to` is
equal to `length` here.

The issue was introduced in 5d15a8d (0.8.5).

This closes nginx#794 issue on Github.
Previous incorrect fix was introduced in 5d15a8d (0.8.5).
With empty buffers in both the self and search cases.
Copy link
Contributor

@VadimZhestikov VadimZhestikov left a comment

Choose a reason for hiding this comment

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

Looks good

@xeioex xeioex merged commit 5a8bb2d into nginx:master Oct 10, 2024
1 check passed
@xeioex xeioex deleted the fix_buffer_indexOf branch October 10, 2024 16:43
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