]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smtp: remove SCMimeSmtpConfigExtractUrlsSchemeReset
authorJason Ish <jason.ish@oisf.net>
Tue, 25 Feb 2025 16:15:57 +0000 (10:15 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 27 Feb 2025 05:57:44 +0000 (06:57 +0100)
It doesn't appear to be needed. The vec being cleared is only set once
per run, so never needs to be cleared.

Removes one point where we have to supress the static_mut_refs compiler
warning.

Ticket: #7417

rust/src/mime/smtp.rs
src/app-layer-smtp.c

index a937251c00e35ba268d1fdb9b0a3e0fc6224b54b..5dddbe0b103646361213beeb7e731f4a05b7f673 100644 (file)
@@ -742,11 +742,6 @@ pub unsafe extern "C" fn SCMimeSmtpConfigHeaderValueDepth(val: u32) {
     MIME_SMTP_CONFIG_HEADER_VALUE_DEPTH = val;
 }
 
-#[no_mangle]
-pub unsafe extern "C" fn SCMimeSmtpConfigExtractUrlsSchemeReset() {
-    MIME_SMTP_CONFIG_EXTRACT_URL_SCHEMES.clear();
-}
-
 #[no_mangle]
 pub unsafe extern "C" fn SCMimeSmtpConfigExtractUrlsSchemeAdd(
     str: *const std::os::raw::c_char,
index 472ef7b040e2f5d3dea003114ea6f9c71fcf5aac..47c365f3893090cf714b6a327b547590b5d23018 100644 (file)
@@ -356,7 +356,6 @@ static void SMTPConfigure(void) {
         if (extract_urls_schemes) {
             ConfNode *scheme = NULL;
 
-            SCMimeSmtpConfigExtractUrlsSchemeReset();
             TAILQ_FOREACH (scheme, &extract_urls_schemes->head, next) {
                 size_t scheme_len = strlen(scheme->val);
                 if (scheme_len > UINT16_MAX - SCHEME_SUFFIX_LEN) {
@@ -383,7 +382,6 @@ static void SMTPConfigure(void) {
         } else {
             /* Add default extract url scheme 'http' since
              * extract-urls-schemes wasn't found in the config */
-            SCMimeSmtpConfigExtractUrlsSchemeReset();
             SCMimeSmtpConfigExtractUrlsSchemeAdd("http://");
         }