Skip to content

Commit 09ee471

Browse files
lkarstenFelipe Zimmerle
authored andcommitted
Handle zero byte rule files correctly.
This corrects the stalling behaviour seen when trying to parse an empty rule file. Fixes: #1521
1 parent 945ee27 commit 09ee471

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/parser/driver.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ int Driver::parse(const std::string &f, const std::string &ref) {
134134
this->ref.push_back(ref);
135135
}
136136

137+
if (f.empty()) {
138+
return 1;
139+
}
140+
137141
buffer = f;
138142
scan_begin();
139143
yy::seclang_parser parser(*this);

0 commit comments

Comments
 (0)