From 3ba73136738da5ee1c367a26eea24aa46e0bb385 Mon Sep 17 00:00:00 2001 From: Ofec Israel Date: Fri, 13 Dec 2024 10:03:39 +0200 Subject: [PATCH] Prevent segfault when trace tag is missing after -t option --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 8a96e07..3134a45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,6 +99,10 @@ int main( int argc, char* argv[] ) } else if (arg=="-t") { + if (i >= nargs) + { + EO_FATAL() << "Error: Missing trace tag."; + } std::string targ(argv[i]); i++; #ifdef EO_TRACING