Skip to content

Commit

Permalink
DIagnostics: Strengthened check
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC committed Nov 7, 2023
1 parent 4c10faa commit 383146a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dCommon/Diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ void CatchUnhandled(int sig) {
std::string functionName = strings[i];
std::string::size_type start = functionName.find('(');
std::string::size_type end = functionName.find('+');
if (start != std::string::npos && end != std::string::npos) {
// strengthened check
if (start != std::string::npos && start + 1 < functionName.size() && end != std::string::npos && start < end) {
std::string demangled = functionName.substr(start + 1, end - start - 1);

demangled = Demangler::Demangle(demangled.c_str());
Expand Down

0 comments on commit 383146a

Please sign in to comment.