]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4751: Rid of removed base template
authorOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Tue, 20 May 2025 12:33:31 +0000 (12:33 +0000)
committerOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Tue, 20 May 2025 12:33:31 +0000 (12:33 +0000)
Merge in SNORT/snort3 from ~OSHUMEIK/snort3:fix_base_template to master

Squashed commit of the following:

commit 834b202ae4ea196e643df15403e7e86759dc1f3f
Author: Oleksii Shumeiko <oshumeik@cisco.com>
Date:   Mon May 19 18:22:41 2025 +0300

    http2_inspect: rid of removed base template

    The base template for std::char_traits has been removed.

src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.cc
src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.h

index a71d0164af7f7e2c85a67e78546827b792e26ded..df767b94a44827329375eb8bcab987e0480d748d 100644 (file)
@@ -31,15 +31,15 @@ void Http2CookieHeaderBuffer::append_value(const uint8_t* start, int32_t length)
     // quoting (RFC 6265) for specifics to cookies.
     if ( !buffer.empty() )
     {
-        buffer += (const uint8_t*)"; ";
+        buffer += "; ";
     }
     else
     {
         // let's initialize the buffer to reduce dynamic allocation for std::basic_string<uint8_t>;
         buffer.reserve(Http2CookieHeaderBuffer::initial_buffer_size);
-        buffer = (const uint8_t*)"cookie: ";
+        buffer = "cookie: ";
     }
-    buffer.append(start, length);
+    buffer.append((const char*)start, length);
 }
 
 bool Http2CookieHeaderBuffer::append_header_in_decoded_headers(uint8_t* decoded_header_buffer,
@@ -48,10 +48,10 @@ bool Http2CookieHeaderBuffer::append_header_in_decoded_headers(uint8_t* decoded_
 {
     if ( !buffer.empty() )
     {
-        buffer += (const uint8_t*)"\r\n";
+        buffer += "\r\n";
     }
-    const u8string& in = buffer;
-    const uint32_t in_length = in.length();
+    const std::string& in = buffer;
+    const uint32_t in_length = in.size();
 
     bytes_written = 0;
 
index 4cf7743cf2ce1b0b4172f438702926e47c98826b..dee08a9b76f9f3dbfb394c7d225dd786b4898572 100644 (file)
@@ -30,7 +30,6 @@ using Http2Infractions = Infractions<Http2Enums::INF__MAX_VALUE, Http2Enums::INF
 
 class Http2CookieHeaderBuffer final
 {
-    using u8string = std::basic_string<uint8_t>;
 public:
     void append_value(const uint8_t* start, int32_t length);
     bool append_header_in_decoded_headers(uint8_t* decoded_header_buffer,
@@ -45,7 +44,7 @@ public:
     }
 
 private:
-    u8string buffer = (const uint8_t*)"";
+    std::string buffer;
 
     static const uint32_t initial_buffer_size = 1024;
     static const uint8_t* cookie_key;