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:
Lasse Karstensen
2017-08-03 14:31:54 +02:00
committed by Felipe Zimmerle
parent 945ee27a85
commit 09ee471498

View File

@@ -134,6 +134,10 @@ int Driver::parse(const std::string &f, const std::string &ref) {
this->ref.push_back(ref);
}
if (f.empty()) {
return 1;
}
buffer = f;
scan_begin();
yy::seclang_parser parser(*this);