diff options
| author | Dan Engelbrecht <[email protected]> | 2025-08-05 09:39:28 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-08-05 09:39:28 +0200 |
| commit | 34c8c53de8ddaff19e81fd1d3c520563c4f39a3b (patch) | |
| tree | b82bc18f6d7698954af497d49cf91f506346fc5b /src/zencore/callstack.cpp | |
| parent | Don't set m_DispatchComplete in ParallelWork until after pending work countdo... (diff) | |
| download | zen-34c8c53de8ddaff19e81fd1d3c520563c4f39a3b.tar.xz zen-34c8c53de8ddaff19e81fd1d3c520563c4f39a3b.zip | |
de/stringbuilder safety (#456)
- Improvement: Safeguard FormatCallstack to not throw exceptions when building the callstack string
- Improvement: Limit thread name length when setting it for debugger use
- Improvemnet: Don't allow assert callbacks to throw exception
- Improvement: When formatting log output for malformed attachments in a package message, allow the string buffer to grow instead of throwing exception
Diffstat (limited to 'src/zencore/callstack.cpp')
| -rw-r--r-- | src/zencore/callstack.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/zencore/callstack.cpp b/src/zencore/callstack.cpp index 9b06d4575..b22f2ec1f 100644 --- a/src/zencore/callstack.cpp +++ b/src/zencore/callstack.cpp @@ -179,19 +179,26 @@ FormatCallstack(const CallstackFrames* Callstack, StringBuilderBase& SB, std::st bool First = true; for (const std::string& Symbol : GetFrameSymbols(Callstack)) { - if (!First) + try { - SB.Append("\n"); - } - else - { - First = false; + if (!First) + { + SB.Append("\n"); + } + else + { + First = false; + } + if (!Prefix.empty()) + { + SB.Append(Prefix); + } + SB.Append(Symbol); } - if (!Prefix.empty()) + catch (const std::exception&) { - SB.Append(Prefix); + break; } - SB.Append(Symbol); } } |