diff options
author | Anatol Belski <ab@php.net> | 2016-08-03 18:26:29 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-08-03 18:31:29 +0200 |
commit | 8889b13853481c31b2c652b1c1bbc8d42468542e (patch) | |
tree | 22b44011f660c467011bbeff7db762d3e196b018 | |
parent | e0e2323e7d06738155c2657cc34707cb5ea139c5 (diff) | |
download | php-git-php-7.0.10RC1.tar.gz |
improve the check, avoid strlen on NULLphp-7.0.10RC1
(cherry picked from commit 9667ee4f72c7dafce993b71104a52beb7c3aff15)
-rw-r--r-- | ext/exif/exif.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c index a7452184f9..611b1067cc 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1702,11 +1702,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; |