From: Eric Leblond Date: Tue, 12 May 2015 15:31:56 +0000 (+0200) Subject: smtp-layer: add HELO parsing test in unittest X-Git-Tag: suricata-3.0RC1~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=534360fc0202c66d8877c5c8b55dbee5ead320b8;p=thirdparty%2Fsuricata.git smtp-layer: add HELO parsing test in unittest --- 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 ||