Skip to content

Commit

Permalink
Pointer arithmetic on void pointers is illegal
Browse files Browse the repository at this point in the history
We quick-fix this by casting to char*; it might be more appropriate to
use char pointers in the first place.
  • Loading branch information
cmb69 authored and sgolemon committed Apr 2, 2019
1 parent 330f171 commit d1df5d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/exif/exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d1df5d5

Please sign in to comment.