com php-src: Pointer arithmetic on void pointers is illegal: ext/exif/exif.c
| From: | Sara Golemon | Date: | Tue, 02 Apr 2019 15:02:06 +0000 |
| Subject: | com php-src: Pointer arithmetic on void pointers is illegal: ext/exif/exif.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105485@lists.php.net to get a copy of this message | ||
Commit: d1df5d54be9e957997df594292ead19b02d8f9a0
Author: Christoph M. Becker <cmbecker69@gmx.de> Tue, 2 Apr 2019 10:37:40 +0200
Committer: Sara Golemon <pollita@php.net> Tue, 2 Apr 2019 11:02:06 -0400
Parents: 330f1716df49c0d3474c18b6dcd370a9dcf57422
Branches: PHP-7.2..17
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d1df5d54be9e957997df594292ead19b02d8f9a0
Log:
Pointer arithmetic on void pointers is illegal
We quick-fix this by casting to char*; it might be more appropriate to
use char pointers in the first place.
Changed paths:
M ext/exif/exif.c
Diff:
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 75f59d7..03c6b98 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -2148,9 +2148,9 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index,
c
} else {
info_value = &info_data->value;
}
- vptr_end = value+value_len;
+ vptr_end = (char *) value + value_len;
for (idex=0,vptr=value; idex<(size_t)length; idex++,vptr=(char *) vptr +
php_tiff_bytes_per_format[format]) {
- if (vptr_end - vptr < php_tiff_bytes_per_format[format]) {
+ if ((char *) vptr_end - (char *) vptr < php_tiff_bytes_per_format[format]) {
exif_error_docref("exif_iif_add_value" EXIFERR_CC, image_info, E_WARNING,
"Value too short");
break;
}