summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-01-18 19:06:29 +0000
committerMarcus Boerger <helly@php.net>2003-01-18 19:06:29 +0000
commit9d02c2bd5647c2f2ebb7071d51141469abd3f8cf (patch)
tree044ae1082fda06b599022f3b9271a3cd89b0c76e
parent310397f2eebbe9951165a5551274583b6cd12ef0 (diff)
downloadphp-git-9d02c2bd5647c2f2ebb7071d51141469abd3f8cf.tar.gz
correct my fault here and documnet the sense of the test
-rw-r--r--ext/exif/exif.c7
1 files changed, 3 insertions, 4 deletions
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;