mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-04 05:22:57 +03:00
Handle zero byte rule files correctly.
This corrects the stalling behaviour seen when trying to parse an empty rule file. Fixes: #1521
This commit is contained in:
committed by
Felipe Zimmerle
parent
945ee27a85
commit
09ee471498
@@ -134,6 +134,10 @@ int Driver::parse(const std::string &f, const std::string &ref) {
|
|||||||
this->ref.push_back(ref);
|
this->ref.push_back(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (f.empty()) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
buffer = f;
|
buffer = f;
|
||||||
scan_begin();
|
scan_begin();
|
||||||
yy::seclang_parser parser(*this);
|
yy::seclang_parser parser(*this);
|
||||||
|
Reference in New Issue
Block a user