]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smtp-layer: add HELO parsing test in unittest
authorEric Leblond <eric@regit.org>
Tue, 12 May 2015 15:31:56 +0000 (17:31 +0200)
committerEric Leblond <eric@regit.org>
Tue, 6 Oct 2015 21:30:45 +0000 (23:30 +0200)
src/app-layer-smtp.c

index 139533468f9c1393ad4e600a4011f3251773c70f..d95bc73896c5853b4d48c449356b1c2567a68a75 100644 (file)
@@ -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 ||