From: Philippe Antoine Date: Thu, 18 Apr 2019 14:04:50 +0000 (+0200) Subject: smtp: rset command resets bdat chunks length X-Git-Tag: suricata-5.0.0-beta1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43e205fc32ea14d0c466572fd418e725b79c94d0;p=thirdparty%2Fsuricata.git smtp: rset command resets bdat chunks length Fixes #1860 --- 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; }