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

Avoid buffer-overflow in Array.slice when using fast arrays #4797

Merged

Conversation

galpeter
Copy link
Contributor

In the Array.slice method when the engine uses fast arrays the "end" value
was not updated if the input array's length changed. This can occur when the start/end
index normalization executes a method and the length is changed forcefully.
This leads to a buffer-overflow as the element copy reads too much data from the input
array.

Fixes: #4777

In the Array.slice method when the engine uses fast arrays the "end" value
was not updated if the input array's length changed. This can occur when the start/end
index normalization executes a method and the length is changed forcefully.
This leads to a buffer-overflow as the element copy reads too much data from the input
array.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
@galpeter galpeter added the bug Undesired behaviour label Oct 18, 2021
Copy link
Member

@rerobika rerobika left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

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

LGTM

@rerobika rerobika merged commit 4912e3b into jerryscript-project:master Oct 20, 2021
26 checks passed
laiyoufafa pushed a commit to laiyoufafa/third_party_jerryscript that referenced this pull request Apr 13, 2023
…n using fast arrays'

Related patch: jerryscript-project/jerryscript#4797

Signed-off-by: gavin1012_hw <wanggang203@huawei.com>
laiyoufafa pushed a commit to laiyoufafa/third_party_jerryscript that referenced this pull request Apr 13, 2023
…n using fast arrays'

Related patch: jerryscript-project/jerryscript#4797

Signed-off-by: gavin1012_hw <wanggang203@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

heap-buffer-overflow in ecma_builtin_array_prototype_object_slice
3 participants