bryancall opened a new pull request, #14074:
URL: https://github.com/apache/trafficserver/pull/14074

   Fixes 23 Coverity Scan defects in unit test code. No production code changes.
   
   Lengths guarded only by REQUIRE. Coverity cannot see a Catch2 REQUIRE as a 
guard, so lengths that come from a function able to return a negative error 
value were still reported as possibly negative (test_LogEntryJson, 
test_LogAccess, test_Http2Frame, the Huffman round-trip fuzz test and the HPACK 
oversized-literal test). #13687 cast the test_LogEntryJson and test_LogAccess 
lengths to size_t after the REQUIRE, which did not clear them. They now go 
through a plain conditional that maps a negative value to zero, or a std::min 
clamp to the buffer. The REQUIREs stay, so a bad length still fails the test.
   
   Copies that could be moves. Last-use locals are now moved in test_ip_data 
(into the rule list), test_SSLSecret, test_ConnectingEntry, test_mime and 
benchmark_InactivityCop. The first ConnectingEntry case keeps its copy because 
it reads the count after the entry is deleted. The duplicate-key lambda in 
test_ConfigRegistry has to return a copy, since the next registration clears 
the message list, so it now names std::string as its return type.
   
   Locking. The SSL_SECRET serialization test reads its hook counter under the 
mutex that guards every write to it. The RoundBarrier in test_Regex notifies 
while holding its lock instead of unlocking by hand first.
   
   Null walk. The bucket-chain test in test_CacheDir asserts each hop of its 
free-list walk, the same way dir_corrupt_bucket() in that file already does.
   
   Testing: built with the ci-fedora-urtest preset, ENABLE_ASAN and warnings as 
errors in the fedora:45 CI image; all 1400 ctest tests pass.
   


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