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 string out of bounds access issue #702

Merged
merged 1 commit into from
Feb 22, 2022
Merged

Conversation

davide125
Copy link
Contributor

last_char can become negative here, which can result in attempting to index the string at an invalid position, which leads to

/usr/include/c++/12/bits/basic_string.h:1201: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) const [with _CharT = unsigned int; _Traits = std::char_traits<unsigned int>; _Alloc = std::allocator<unsigned int>; const_reference = const unsigned int&; size_type = long unsigned int]: Assertion '__pos <= size()' failed.
Aborted (core dumped)

@mickelson mickelson merged commit 24fa40d into mickelson:master Feb 22, 2022
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