]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #5213: framework: return original string if list is empty
authorOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Mon, 16 Mar 2026 10:45:14 +0000 (10:45 +0000)
committerOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Mon, 16 Mar 2026 10:45:14 +0000 (10:45 +0000)
Merge in SNORT/snort3 from ~OSHUMEIK/snort3:dump_empty_list to master

Squashed commit of the following:

commit 5f227716feac1995e8671f6c1d544bae3d4c547a
Author: Oleksii Shumeiko <oshumeik@cisco.com>
Date:   Fri Mar 13 16:53:07 2026 +0200

    framework: return original string if list is empty

    Value returns original string when parsing failed to extract list items.

src/framework/value.cc

index 6ece0c7be14d40ee3984243769072c8681e52704..bf3dd10be9892bb89ea82058f824627b73ecc8fa 100644 (file)
@@ -271,6 +271,10 @@ std::string Value::get_origin_string() const
         value += token;
         value += " ";
     }
+
+    if ( value.empty() )
+        return origin_str;
+
     value.erase(value.size() - 1);
 
     return value;