diff --git a/test/common/router/header_parser_corpus/clusterfuzz-testcase-minimized-header_parser_fuzz_test-5630125928873984 b/test/common/router/header_parser_corpus/clusterfuzz-testcase-minimized-header_parser_fuzz_test-5630125928873984 new file mode 100644 index 000000000000..51cef79477d3 --- /dev/null +++ b/test/common/router/header_parser_corpus/clusterfuzz-testcase-minimized-header_parser_fuzz_test-5630125928873984 @@ -0,0 +1 @@ +headers_to_add { header { key: " " value: "%START_TIME(�)%" } } request_info { start_time: 72059116831228591 } diff --git a/test/fuzz/utility.h b/test/fuzz/utility.h index 4536ae49bb08..f50659e0c3f2 100644 --- a/test/fuzz/utility.h +++ b/test/fuzz/utility.h @@ -36,7 +36,13 @@ inline test::fuzz::Headers toHeaders(const Http::HeaderMap& headers) { inline TestRequestInfo fromRequestInfo(const test::fuzz::RequestInfo& request_info) { TestRequestInfo test_request_info; test_request_info.metadata_ = request_info.dynamic_metadata(); - test_request_info.start_time_ = SystemTime(std::chrono::microseconds(request_info.start_time())); +#ifdef __APPLE__ + // Clocks don't track at nanosecond on OS X. + test_request_info.start_time_ = + SystemTime(std::chrono::microseconds(request_info.start_time() / 1000)); +#else + test_request_info.start_time_ = SystemTime(std::chrono::nanoseconds(request_info.start_time())); +#endif if (request_info.has_response_code()) { test_request_info.response_code_ = request_info.response_code().value(); }