mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
improve the check, avoid strlen on NULL
This commit is contained in:
parent
f15c155363
commit
9667ee4f72
@ -1708,11 +1708,11 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
if (!length)
|
||||
break;
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = MIN(length, strlen(value));
|
||||
}
|
||||
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = MIN(length, strlen(value));
|
||||
}
|
||||
|
||||
/* do not recompute length here */
|
||||
info_value->s = estrndup(value, length);
|
||||
info_data->length = length;
|
||||
|
Loading…
Reference in New Issue
Block a user