bryancall commented on code in PR #13687:
URL: https://github.com/apache/trafficserver/pull/13687#discussion_r4017604185
##########
src/proxy/http2/unit_tests/test_HpackIndexingTable.cc:
##########
@@ -94,7 +94,10 @@ TEST_CASE("HPACK low level APIs", "[hpack]")
REQUIRE(len > 0);
REQUIRE(len == i.encoded_field_len);
- REQUIRE(memcmp(buf, i.encoded_field, len) == 0);
+
+ size_t const encoded_len = static_cast<size_t>(len);
Review Comment:
Fixed at both sites in cdaf655607. You are right that deriving the bound
from `len` left the finding intact — the narrowing was applied to the value
`REQUIRE` cannot constrain, which defeats the point. Both now compare
`static_cast<size_t>(..._test_case[...].encoded_field_len)` and keep
`REQUIRE(len == ...encoded_field_len)` as the runtime check of the encoder,
which matches what the other files in this PR already did. The pre-existing `//
coverity[overrun-buffer-arg]` annotation at the literal site is preserved,
since it covers a different checker.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]