From 944e6f9ad4facf6be5dc1ea98b47963178929243 Mon Sep 17 00:00:00 2001 From: Ivan Posva Date: Thu, 12 Dec 2019 01:51:23 +0000 Subject: [PATCH 1/2] Create testcase-5759629707444224. --- test/core/slice/b64_decode_corpus/testcase-5759629707444224 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/core/slice/b64_decode_corpus/testcase-5759629707444224 diff --git a/test/core/slice/b64_decode_corpus/testcase-5759629707444224 b/test/core/slice/b64_decode_corpus/testcase-5759629707444224 new file mode 100644 index 00000000000..b01bd95e5ca --- /dev/null +++ b/test/core/slice/b64_decode_corpus/testcase-5759629707444224 @@ -0,0 +1,6 @@ +=0þ5==0_ + + +==0_ + +==0_==0_ \ No newline at end of file From a1cf1eb4bcba22ffa20450cbc880a53b9e7f3814 Mon Sep 17 00:00:00 2001 From: Ivan Posva Date: Thu, 12 Dec 2019 01:58:57 +0000 Subject: [PATCH 2/2] Fix leak when running b64_decode_fuzzer tests. --- test/core/slice/b64_decode_fuzzer.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/core/slice/b64_decode_fuzzer.cc b/test/core/slice/b64_decode_fuzzer.cc index 0ef50895f95..96ca91af1b8 100644 --- a/test/core/slice/b64_decode_fuzzer.cc +++ b/test/core/slice/b64_decode_fuzzer.cc @@ -27,7 +27,8 @@ bool leak_check = true; extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (size < 1) return 0; const bool url_safe = static_cast(0x100) < data[0]; - grpc_base64_decode_with_len(reinterpret_cast(data + 1), size - 1, - url_safe); + grpc_slice res = grpc_base64_decode_with_len( + reinterpret_cast(data + 1), size - 1, url_safe); + grpc_slice_unref(res); return 0; }