From c047090178c61a53cb4e38996c36803bc43c7e02 Mon Sep 17 00:00:00 2001 From: Jack Flemming Date: Sun, 26 Jan 2014 19:34:39 -0500 Subject: [PATCH] Don't index into array when cmds is 0 --- src/app-layer-smtp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index c23ef8a..21e2fe7 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -568,6 +568,10 @@ static int SMTPProcessReply(SMTPState *state, Flow *f, SCLogDebug("unable to match reply with request"); SCReturnInt(-1); } + + if (state->cmds_cnt == 0) { + return 0; + } } if (state->cmds[state->cmds_idx] == SMTP_COMMAND_STARTTLS) { -- 1.8.5.1