mcclellan: handle 0 length block scans correctly

This commit is contained in:
Alex Coyte 2017-01-03 12:57:10 +11:00 committed by Matthew Barr
parent c699e98750
commit 10346f53f7

View File

@ -375,7 +375,9 @@ char mcclellanExec8_i(const struct mcclellan *m, u32 *state, const u8 *buf,
size_t len, u64a offAdj, NfaCallback cb, void *ctxt,
char single, const u8 **c_final, enum MatchMode mode) {
if (!len) {
*c_final = buf;
if (mode == STOP_AT_MATCH) {
*c_final = buf;
}
return MO_ALIVE;
}
u32 s = *state;