diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 195924e7191..bc5d1c7443f 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -5107,6 +5107,8 @@ void Tokenizer::setVarIdPass2() classnameTokens.push_back(tokStart->next()); tokStart = tokStart->tokAt(2); } + if (!tokStart) + syntaxError(tok); } std::string classname; diff --git a/test/cli/fuzz-crash_c/crash-7af21bec1d9be105742fdcb336514aae26ab4425 b/test/cli/fuzz-crash_c/crash-7af21bec1d9be105742fdcb336514aae26ab4425 new file mode 100644 index 00000000000..6620c0d315f --- /dev/null +++ b/test/cli/fuzz-crash_c/crash-7af21bec1d9be105742fdcb336514aae26ab4425 @@ -0,0 +1,2 @@ +i +class q::_ \ No newline at end of file