Skip to content

Commit 1b3cbb2

Browse files
committed
fuzz: use nanoseconds for SystemTime in RequestInfo.
Avoids integer overflow that was previously occurring due to time in micros being too large, allows exercise of nanosecond resolution formatters beyond all zero. Fixes oss-fuzz issue https://oss-fuzz.com/v2/testcase-detail/5630125928873984. Risk level: Low Testing: Corpus entry added. Signed-off-by: Harvey Tuch <[email protected]>
1 parent 28d5f41 commit 1b3cbb2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
headers_to_add { header { key: " " value: "%START_TIME(�)%" } } request_info { start_time: 72059116831228591 }

test/fuzz/utility.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ inline test::fuzz::Headers toHeaders(const Http::HeaderMap& headers) {
3636
inline TestRequestInfo fromRequestInfo(const test::fuzz::RequestInfo& request_info) {
3737
TestRequestInfo test_request_info;
3838
test_request_info.metadata_ = request_info.dynamic_metadata();
39-
test_request_info.start_time_ = SystemTime(std::chrono::microseconds(request_info.start_time()));
39+
test_request_info.start_time_ = SystemTime(std::chrono::nanoseconds(request_info.start_time()));
4040
if (request_info.has_response_code()) {
4141
test_request_info.response_code_ = request_info.response_code().value();
4242
}

0 commit comments

Comments
 (0)