From 534360fc0202c66d8877c5c8b55dbee5ead320b8 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 12 May 2015 17:31:56 +0200 Subject: [PATCH] smtp-layer: add HELO parsing test in unittest --- src/app-layer-smtp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 139533468f..d95bc73896 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -4494,6 +4494,13 @@ int SMTPParserTest14(void) SCMutexUnlock(&f.m); goto end; } + + if ((smtp_state->helo_len != 7) || strncmp("boo.com", (char *)smtp_state->helo, 7)) { + printf("incorrect parsing of HELO field '%s' (%d)\n", smtp_state->helo, smtp_state->helo_len); + SCMutexUnlock(&f.m); + goto end; + } + SCMutexUnlock(&f.m); if (smtp_state->input_len != 0 || smtp_state->cmds_cnt != 0 || -- 2.47.2