-
-
Notifications
You must be signed in to change notification settings - Fork 254
Fix potential out-of-bounds access by checking if start
is empty before removing prefix
#681
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
Conversation
Hello @flylai, thanks for the PR! Could you please also add a test for this change? You find them under Andreas |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #681 +/- ##
=======================================
Coverage 97.85% 97.85%
=======================================
Files 20 20
Lines 6534 6535 +1
=======================================
+ Hits 6394 6395 +1
Misses 140 140
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
af89105
to
59bd291
Compare
Hi @andreasfertig |
Hello @flylai, thanks for the test! Unfortunately, it failed. I suspect for the output you posted you had other C++ Insights options enabled? Andreas |
…fore removing prefix
Hi @andreasfertig
and the cmake output:
and the latest output is
It is still different with the macOS test result, I will adjust the test result. |
If the code contains compiler builtin functions, it will crash with
/usr/include/c++/14.2.1/string_view:297: constexpr void std::basic_string_view<_CharT, _Traits>::remove_prefix(size_type) [with _CharT = char; _Traits = std::char_traits<char>; size_type = long unsigned int]: Assertion 'this->_M_len >= __n' failed.
In other words: "support compiler builtin functions"
eg:
after fixes, the result is: