mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Avoid segfault if parser `ref' is empty
This commit is contained in:
committed by
Felipe Zimmerle
parent
f65b08b066
commit
c035e76ede
@@ -167,7 +167,9 @@ void Driver::error(const yy::location& l, const std::string& m,
|
||||
const std::string& c) {
|
||||
if (parserError.tellp() == 0) {
|
||||
parserError << "Rules error. ";
|
||||
parserError << "File: " << ref.back() << ". ";
|
||||
if (ref.empty() == false) {
|
||||
parserError << "File: " << ref.back() << ". ";
|
||||
}
|
||||
parserError << "Line: " << l.end.line << ". ";
|
||||
parserError << "Column: " << l.end.column << ". ";
|
||||
}
|
||||
|
Reference in New Issue
Block a user