mirror of
https://github.com/php/php-src.git
synced 2025-01-24 20:53:37 +08:00
correct my fault here and documnet the sense of the test
This commit is contained in:
parent
310397f2ee
commit
9d02c2bd56
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user