Skip to content

fix heap-buffer-overflow in lexer_compare_identifier_to_char #5228

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

happy-boy-maker
Copy link

@happy-boy-maker happy-boy-maker commented May 20, 2025

This patch fixes #5066
There is a problem there. When size is passed to 0 in lexer_compare_identifier_to_char, because of do while(size > 0) and the size type is uint, it will cause an unexpected loop and result in heap overflow

@happy-boy-maker happy-boy-maker marked this pull request as draft May 20, 2025 08:07
@happy-boy-maker happy-boy-maker marked this pull request as ready for review May 20, 2025 08:15
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

}
}

check_syntax_error("class C {#static async''");
Copy link
Member

Choose a reason for hiding this comment

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

Add a newline at the end, please

Copy link
Author

Choose a reason for hiding this comment

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

ok

JerryScript-DCO-1.0-Signed-off-by: tangbin 2387440390@qq.com
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.

heap-buffer-overflow in lexer_compare_identifier_to_chars
2 participants