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

Unified Diff: third_party/libtiff/tif_aux.c

Issue 2405693002: libtiff: Prevent a buffer overflow in function ChopUpSingleUncompressedStrip. (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/libtiff/README.pdfium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libtiff/tif_aux.c
diff --git a/third_party/libtiff/tif_aux.c b/third_party/libtiff/tif_aux.c
index 3ce3680ab2ae23cd86654230d47b2aaf81c18955..bc4ea0192815137f2d55031e70fbd0ee2d130d9e 100644
--- a/third_party/libtiff/tif_aux.c
+++ b/third_party/libtiff/tif_aux.c
@@ -69,7 +69,7 @@ _TIFFCheckRealloc(TIFF* tif, void* buffer,
/*
* XXX: Check for integer overflow.
*/
- if (nmemb && elem_size && !_TIFFIfMultiplicationOverflow(nmemb, elem_size))
+ if (nmemb > 0 && elem_size > 0 && !_TIFFIfMultiplicationOverflow(nmemb, elem_size))
hong_zhang 2016/10/17 18:07:38 Hi, may I ask why? I thought tmsize_t is unsigned.
Tom Sepez 2016/10/17 18:20:04 nmemb is tmsize_t. tmsize_t is TIFF_SSIZE_T at h
cp = _TIFFrealloc(buffer, bytes);
if (cp == NULL) {
« no previous file with comments | « third_party/libtiff/README.pdfium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698