security fix (patch 1089659)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2004-12-24 11:48:14 +00:00
parent 914ca1d826
commit 2c15c98b33
3 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
3.6.1-2
3.6.1-3

View File

@ -67,7 +67,7 @@ CheckMalloc(TIFF* tif, size_t nmemb, size_t elem_size, const char* what)
char *cp = NULL;
tsize_t bytes = nmemb * elem_size;
if (elem_size && bytes / elem_size == nmemb)
if (nmemb && elem_size && bytes / elem_size == nmemb)
cp = (char*)_TIFFmalloc(bytes);
if (cp == NULL)

View File

@ -443,7 +443,7 @@ CheckMalloc(TIFF* tif, size_t nmemb, size_t elem_size, const char* what)
char *cp = NULL;
tsize_t bytes = nmemb * elem_size;
if (elem_size && bytes / elem_size == nmemb)
if (nmemb && elem_size && bytes / elem_size == nmemb)
cp = (char*) _TIFFmalloc(bytes);
if (cp == NULL)