diff options
| author | Marcus Boerger <helly@php.net> | 2003-01-18 19:06:29 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-01-18 19:06:29 +0000 |
| commit | 9d02c2bd5647c2f2ebb7071d51141469abd3f8cf (patch) | |
| tree | 044ae1082fda06b599022f3b9271a3cd89b0c76e | |
| parent | 310397f2eebbe9951165a5551274583b6cd12ef0 (diff) | |
| download | php-git-9d02c2bd5647c2f2ebb7071d51141469abd3f8cf.tar.gz | |
correct my fault here and documnet the sense of the test
| -rw-r--r-- | ext/exif/exif.c | 7 |
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; |
