From: Anatol Belski Date: Wed, 3 Aug 2016 16:26:29 +0000 (+0200) Subject: improve the check, avoid strlen on NULL X-Git-Tag: php-5.6.25RC1~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9667ee4f72c7dafce993b71104a52beb7c3aff15;p=php improve the check, avoid strlen on NULL --- diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 94652e909b..f95de3a14f 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -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;