]> granicus.if.org Git - php/commitdiff
correct my fault here and documnet the sense of the test
authorMarcus Boerger <helly@php.net>
Sat, 18 Jan 2003 19:06:29 +0000 (19:06 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 18 Jan 2003 19:06:29 +0000 (19:06 +0000)
ext/exif/exif.c

index 31a01b3fbebac13a42a6d935820d82a6d5707992..d91aa5a8b4128fbbf9069137b2297e5a85cf0d91 100644 (file)
@@ -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;