From: Marcus Boerger Date: Sat, 18 Jan 2003 19:06:29 +0000 (+0000) Subject: correct my fault here and documnet the sense of the test X-Git-Tag: PHP_5_0_dev_before_13561_fix~148 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d02c2bd5647c2f2ebb7071d51141469abd3f8cf;p=php correct my fault here and documnet the sense of the test --- diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 31a01b3fbe..d91aa5a8b4 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1486,15 +1486,14 @@ static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_in { void *tmp; + /* This is not a malloc/realloc check. It is a plausibility check for the + * function parameters (requirements engineering). + */ if (section_index >= ImageInfo->file.count) { EXIF_ERRLOG_FSREALLOC return -1; } tmp = erealloc(ImageInfo->file.list[section_index].data, size); - if (size == 0 || section_index >= ImageInfo->file.count) { - return -1; - } - tmp = erealloc(ImageInfo->file.list[section_index].data, size); ImageInfo->file.list[section_index].data = tmp; ImageInfo->file.list[section_index].size = size; return 0;