Skip to content

Commit 01a4de5

Browse files
committed
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.
1 parent 887a7b5 commit 01a4de5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/exif/exif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,9 +1740,9 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
17401740
} else {
17411741
info_value = &info_data->value;
17421742
}
1743-
vptr_end = value+value_len;
1743+
vptr_end = (char *) value + value_len;
17441744
for (idex=0,vptr=value; idex<(size_t)length; idex++,vptr=(char *) vptr + php_tiff_bytes_per_format[format]) {
1745-
if (vptr_end - vptr < php_tiff_bytes_per_format[format]) {
1745+
if ((char *) vptr_end - (char *) vptr < php_tiff_bytes_per_format[format]) {
17461746
exif_error_docref("exif_iif_add_value" EXIFERR_CC, image_info, E_WARNING, "Value too short");
17471747
break;
17481748
}

0 commit comments

Comments
 (0)