1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 19:52:20 +02:00

Merge branch 'PHP-7.3' into PHP-7.4

This commit is contained in:
Nikita Popov
2019-07-29 11:26:15 +02:00
2 changed files with 24 additions and 6 deletions

4
NEWS
View File

@@ -7,6 +7,10 @@ PHP NEWS
(Nikita)
. Fixed bug #78344 (Segmentation fault on zend_check_protected). (Nikita)
- Exif:
. Fixed bug #78333 (Exif crash (bus error) due to wrong alignment and
invalid cast). (Nikita)
- Iconv:
. Fixed bug #78342 (Bus error in configure test for iconv //IGNORE). (Rainer
Jung)

View File

@@ -1515,6 +1515,20 @@ static void php_ifd_set32u(char *data, size_t value, int motorola_intel)
}
/* }}} */
static float php_ifd_get_float(char *data) {
/* Copy to avoid alignment issues */
float f;
memcpy(&f, data, sizeof(float));
return f;
}
static double php_ifd_get_double(char *data) {
/* Copy to avoid alignment issues */
double f;
memcpy(&f, data, sizeof(double));
return f;
}
#ifdef EXIF_DEBUG
char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr) /* {{{ */
{
@@ -1627,12 +1641,12 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
#ifdef EXIF_DEBUG
php_error_docref(NULL, E_NOTICE, "Found value of type single");
#endif
return (double)*(float *)value;
return (double) php_ifd_get_float(value);
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
php_error_docref(NULL, E_NOTICE, "Found value of type double");
#endif
return *(double *)value;
return php_ifd_get_double(value);
}
return 0;
}
@@ -1690,12 +1704,12 @@ static size_t exif_convert_any_to_int(void *value, int format, int motorola_inte
#ifdef EXIF_DEBUG
php_error_docref(NULL, E_NOTICE, "Found value of type single");
#endif
return (size_t)*(float *)value;
return (size_t) php_ifd_get_float(value);
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
php_error_docref(NULL, E_NOTICE, "Found value of type double");
#endif
return (size_t)*(double *)value;
return (size_t) php_ifd_get_double(value);
}
return 0;
}
@@ -2162,13 +2176,13 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
#ifdef EXIF_DEBUG
php_error_docref(NULL, E_WARNING, "Found value of type single");
#endif
info_value->f = *(float *)value;
info_value->f = php_ifd_get_float(value);
break;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
php_error_docref(NULL, E_WARNING, "Found value of type double");
#endif
info_value->d = *(double *)value;
info_value->d = php_ifd_get_double(value);
break;
}
}