From 43e205fc32ea14d0c466572fd418e725b79c94d0 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 18 Apr 2019 16:04:50 +0200 Subject: [PATCH] smtp: rset command resets bdat chunks length Fixes #1860 --- src/app-layer-smtp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 4d9c8ca08f..318264f23e 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -1275,6 +1275,11 @@ static int SMTPProcessRequest(SMTPState *state, Flow *f, SCReturnInt(-1); } state->current_command = SMTP_COMMAND_OTHER_CMD; + } else if (state->current_line_len >= 4 && + SCMemcmpLowercase("rset", state->current_line, 4) == 0) { + // Resets chunk index in case of connection reuse + state->bdat_chunk_idx = 0; + state->curr_tx->done = 1; } else { state->current_command = SMTP_COMMAND_OTHER_CMD; } -- 2.47.2