]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1643 in SNORT/snort3 from ~MIREDDEN/snort3:smtp_fix to master
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Wed, 12 Jun 2019 12:48:03 +0000 (08:48 -0400)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Wed, 12 Jun 2019 12:48:03 +0000 (08:48 -0400)
Squashed commit of the following:

commit 6cbb3b865482a90da05f150f584a457e37209f39
Author: Mike Redden <miredden@cisco.com>
Date:   Wed Jun 12 07:53:18 2019 -0400

    smtp: Fix handle_header_line and normalize_data unit tests

src/service_inspectors/smtp/smtp.cc

index 47fea6ee57374e12619bb66cfaee06682f2a96b6..8af8455fc3dca41e1d31da76c73cc089c206e8cc 100644 (file)
@@ -1599,7 +1599,7 @@ TEST_CASE("handle_header_line", "[smtp]")
     uint8_t* eol = ptr + 38;
     Packet p;
     p.context = new IpsContext(1);
-    
+    SMTP_ResetAltBuffer(&p);
     int res = mime_ssn.handle_header_line(ptr, eol, 0, &p);
     REQUIRE((res == 0));
     unsigned len = 0;
@@ -1618,11 +1618,13 @@ TEST_CASE("normalize_data", "[smtp]")
     snort::DecodeConfig decode_conf;
     SmtpMime mime_ssn(&decode_conf, &log_config);
     smtp_normalizing = true;
+    SMTP_PROTO_CONF config;
+    mime_ssn.config = &config;
     uint8_t ptr[23] = "\r\n--wac7ysb48OaltWcw\r\n";
     uint8_t* data_end = ptr + 22;
     Packet p;
     p.context = new IpsContext(1);
-    
+    SMTP_ResetAltBuffer(&p);
     int res = mime_ssn.normalize_data(ptr, data_end, &p);
     REQUIRE((res == 0));
     unsigned len = 0;