diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 2b8a59a141..9dd7baeed3 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -1431,7 +1431,7 @@ int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *alp_tctx, Flow goto error; } else if (res.status > 0) { DEBUG_VALIDATE_BUG_ON(res.consumed > input_len); - DEBUG_VALIDATE_BUG_ON(res.needed + res.consumed < input_len); + DEBUG_VALIDATE_BUG_ON(res.needed < input_len - res.consumed); DEBUG_VALIDATE_BUG_ON(res.needed == 0); /* incomplete is only supported for TCP */ DEBUG_VALIDATE_BUG_ON(f->proto != IPPROTO_TCP);