Copilot commented on code in PR #13687:
URL: https://github.com/apache/trafficserver/pull/13687#discussion_r4012281904


##########
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:
   This still derives the `memcmp` bound from the API return `len`. Since 
`REQUIRE` is intentionally opaque to Coverity, the preceding equality does not 
constrain that value, so a modeled large positive return can still look like an 
oversized access. Use the known table length here; keep the `REQUIRE(len == 
i.encoded_field_len)` as the runtime check of the API result.
   
   This issue also appears on line 247 of the same file.



-- 
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]

Reply via email to