Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Unified Diff: testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc

Issue 1809383002: [libfuzzer] Prevent division by zero in libpng_read_fuzzer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc b/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
index 8599f4b0c69b58a99f28bfb802221a8dedf90575..ca9b0427bef2ce2f16605947f5ddeb01e37f611f 100644
--- a/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
@@ -92,7 +92,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
}
// This is going to be too slow.
- if (height > 100000000 / width)
+ if (width && height > 100000000 / width)
aizatsky 2016/03/18 17:18:18 Is this written to prevent overflow? width * heigh
mmoroz 2016/03/21 09:07:37 Yes, this is for overflow prevention (from here: h
return 0;
int passes = png_set_interlace_handling(png_ptr);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698