From: Oleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) Date: Tue, 20 May 2025 12:33:31 +0000 (+0000) Subject: Pull request #4751: Rid of removed base template X-Git-Tag: 3.8.1.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf7ad5ef03d9063a21d5b8584388e6174fda3356;p=thirdparty%2Fsnort3.git Pull request #4751: Rid of removed base template Merge in SNORT/snort3 from ~OSHUMEIK/snort3:fix_base_template to master Squashed commit of the following: commit 834b202ae4ea196e643df15403e7e86759dc1f3f Author: Oleksii Shumeiko 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. --- diff --git a/src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.cc b/src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.cc index a71d0164a..df767b94a 100644 --- a/src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.cc +++ b/src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.cc @@ -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; 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; diff --git a/src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.h b/src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.h index 4cf7743cf..dee08a9b7 100644 --- a/src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.h +++ b/src/service_inspectors/http2_inspect/http2_hpack_cookie_header_buffer.h @@ -30,7 +30,6 @@ using Http2Infractions = Infractions; 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;