aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/trace.cpp
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2026-03-09 19:06:36 -0700
committerLiam Mitchell <[email protected]>2026-03-09 19:06:36 -0700
commitd1abc50ee9d4fb72efc646e17decafea741caa34 (patch)
treee4288e00f2f7ca0391b83d986efcb69d3ba66a83 /src/zencore/trace.cpp
parentAllow requests with invalid content-types unless specified in command line or... (diff)
parentupdated chunk–block analyser (#818) (diff)
downloadzen-d1abc50ee9d4fb72efc646e17decafea741caa34.tar.xz
zen-d1abc50ee9d4fb72efc646e17decafea741caa34.zip
Merge branch 'main' into lm/restrict-content-type
Diffstat (limited to 'src/zencore/trace.cpp')
-rw-r--r--src/zencore/trace.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/zencore/trace.cpp b/src/zencore/trace.cpp
index 87035554f..7c195e69f 100644
--- a/src/zencore/trace.cpp
+++ b/src/zencore/trace.cpp
@@ -10,7 +10,16 @@
# define TRACE_IMPLEMENT 1
# undef _WINSOCK_DEPRECATED_NO_WARNINGS
+// GCC false positives in thirdparty trace.h (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100137)
+# if ZEN_COMPILER_GCC
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wstringop-overread"
+# pragma GCC diagnostic ignored "-Wdangling-pointer"
+# endif
# include <zencore/trace.h>
+# if ZEN_COMPILER_GCC
+# pragma GCC diagnostic pop
+# endif
# include <zencore/memory/fmalloc.h>
# include <zencore/memory/memorytrace.h>
@@ -165,10 +174,17 @@ GetTraceOptionsFromCommandline(TraceOptions& OutOptions)
auto MatchesArg = [](std::string_view Option, std::string_view Arg) -> std::optional<std::string_view> {
if (Arg.starts_with(Option))
{
- std::string_view::value_type DelimChar = Arg[Option.length()];
- if (DelimChar == ' ' || DelimChar == '=')
+ if (Arg.length() > Option.length())
+ {
+ std::string_view::value_type DelimChar = Arg[Option.length()];
+ if (DelimChar == ' ' || DelimChar == '=')
+ {
+ return Arg.substr(Option.size() + 1);
+ }
+ }
+ else
{
- return Arg.substr(Option.size() + 1);
+ return ""sv;
}
}
return {};