Compare commits

...
11 Commits
Author SHA1 Message Date
Remi Collet 260468acea Update versions for PHP 7.2.16 2019-03-05 10:49:17 +00:00
Remi Collet 4b605ea89f Update NEWS for PHP 7.2.16 2019-03-05 10:49:16 +00:00
Remi Collet fec3564025 add NEWS entry 2019-03-05 07:34:56 +01:00
Stanislav Malyshev c3c5cc8536 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77630 - safer rename() procedure
2019-03-05 07:34:13 +01:00
Anatol Belski feebf5a2cf Fix test portability 2019-03-05 07:33:54 +01:00
Remi Collet 5829fd84b4 add NEWS entries 2019-03-04 11:13:37 +01:00
Stanislav Malyshev 5f5e9cd610 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow
2019-03-04 11:10:59 +01:00
Stanislav Malyshev b4cece7b60 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename
2019-03-04 11:10:33 +01:00
Remi Collet 39b75e42db Update NEWS for 7.2.16 2019-02-19 10:14:34 +00:00
Remi Collet 2e3d77718d Update CREDITS for PHP 7.2.16RC1 2019-02-19 09:57:31 +00:00
Remi Collet 7261099812 Update NEWS for PHP 7.2.16RC1 2019-02-19 09:57:31 +00:00
19 changed files with 173 additions and 49 deletions

No files matched your search

+14 -1
View File
@@ -1,22 +1,35 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2019, PHP 7.2.16
07 Mar 2019, PHP 7.2.16
- Core:
. Fixed bug #77589 (Core dump using parse_ini_string with numeric sections).
(Laruence)
. Fixed bug #77630 (rename() across the device may allow unwanted access
during processing). (Stas)
- COM:
. Fixed bug #77621 (Already defined constants are not properly reported).
(cmb)
- EXIF:
. Fixed bug #77509 (Uninitialized read in exif_process_IFD_in_TIFF). (Stas)
. Fixed bug #77540 (Invalid Read on exif_process_SOFn). (Stas)
. Fixed bug #77563 (Uninitialized read in exif_process_IFD_in_MAKERNOTE). (Stas)
. Fixed bug #77659 (Uninitialized read in exif_process_IFD_in_MAKERNOTE). (Stas)
- PDO_OCI:
. Support Oracle Database tracing attributes ACTION, MODULE,
CLIENT_INFO, and CLIENT_IDENTIFIER. (Cameron Porter)
- PHAR:
. Fixed bug #77396 (Null Pointer Dereference in phar_create_or_parse_filename).
(bishop)
- SPL:
. Fixed bug #51068 (DirectoryIterator glob:// don't support current path
relative queries). (Ahmed Abdou)
. Fixed bug #77431 (openFile() silently truncates after a null byte). (cmb)
- Standard:
. Fixed bug #77552 (Unintialized php_stream_statbuf in stat functions).
+1 -1
View File
@@ -108,7 +108,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=2
PHP_RELEASE_VERSION=16
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+17 -10
View File
@@ -3152,7 +3152,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
break;
}
if (maker_note->offset >= value_len) {
if (value_len < 2 || maker_note->offset >= value_len - 1) {
/* Do not go past the value end */
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X offset 0x%04X", value_len, maker_note->offset);
return FALSE;
@@ -3207,6 +3207,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
#endif
default:
case MN_OFFSET_NORMAL:
data_len = value_len;
break;
}
@@ -3930,7 +3931,7 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
return FALSE;
marker = c;
length = php_jpg_get16(data+pos);
if (pos+length>=ImageInfo->Thumbnail.size) {
if (length > ImageInfo->Thumbnail.size || pos >= ImageInfo->Thumbnail.size - length) {
return FALSE;
}
#ifdef EXIF_DEBUG
@@ -3951,6 +3952,10 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
case M_SOF14:
case M_SOF15:
/* handle SOFn block */
if (length < 8 || ImageInfo->Thumbnail.size - 8 < pos) {
/* exif_process_SOFn needs 8 bytes */
return FALSE;
}
exif_process_SOFn(data+pos, marker, &sof_info);
ImageInfo->Thumbnail.height = sof_info.height;
ImageInfo->Thumbnail.width = sof_info.width;
@@ -3988,10 +3993,10 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
tag_table_type tag_table = exif_get_tag_table(section_index);
if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) {
return FALSE;
}
return FALSE;
}
if (ImageInfo->FileSize >= dir_offset+2) {
if (ImageInfo->FileSize >= 2 && ImageInfo->FileSize - 2 >= dir_offset) {
sn = exif_file_sections_add(ImageInfo, M_PSEUDO, 2, NULL);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2);
@@ -3999,8 +4004,8 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
php_stream_seek(ImageInfo->infile, dir_offset, SEEK_SET); /* we do not know the order of sections */
php_stream_read(ImageInfo->infile, (char*)ImageInfo->file.list[sn].data, 2);
num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel);
dir_size = 2/*num dir entries*/ +12/*length of entry*/*num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/;
if (ImageInfo->FileSize >= dir_offset+dir_size) {
dir_size = 2/*num dir entries*/ +12/*length of entry*/*(size_t)num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/;
if (ImageInfo->FileSize >= dir_size && ImageInfo->FileSize - dir_size >= dir_offset) {
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries);
#endif
@@ -4083,9 +4088,9 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
}
}
}
if (ImageInfo->FileSize >= dir_offset + ImageInfo->file.list[sn].size) {
if (ImageInfo->FileSize >= ImageInfo->file.list[sn].size && ImageInfo->FileSize - ImageInfo->file.list[sn].size >= dir_offset) {
if (ifd_size > dir_size) {
if (dir_offset + ifd_size > ImageInfo->FileSize) {
if (ImageInfo->FileSize < ifd_size || dir_offset > ImageInfo->FileSize - ifd_size) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size);
return FALSE;
}
@@ -4682,7 +4687,9 @@ PHP_FUNCTION(exif_thumbnail)
ZVAL_STRINGL(return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
if (arg_c >= 3) {
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
exif_scan_thumbnail(&ImageInfo);
if (!exif_scan_thumbnail(&ImageInfo)) {
ImageInfo.Thumbnail.width = ImageInfo.Thumbnail.height = 0;
}
}
zval_dtor(z_width);
zval_dtor(z_height);
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug 77540 (Invalid Read on exif_process_SOFn)
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
$width = $height = 42;
$s = exif_thumbnail(__DIR__."/bug77540.jpg", $width, $height);
echo "Width ".$width."\n";
echo "Height ".$height."\n";
?>
DONE
--EXPECTF--
Width 0
Height 0
DONE
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug 77563 (Uninitialized read in exif_process_IFD_in_MAKERNOTE)
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
$s = exif_thumbnail(__DIR__."/bug77563.jpg");
?>
DONE
--EXPECTF--
Warning: exif_thumbnail(bug77563.jpg): IFD data too short: 0x0009 offset 0x0008 in %s%ebug77563.php on line %d
Warning: exif_thumbnail(bug77563.jpg): File structure corrupted in %s%ebug77563.php on line %d
Warning: exif_thumbnail(bug77563.jpg): Invalid JPEG file in %s%ebug77563.php on line %d
DONE
+3
View File
@@ -1385,6 +1385,9 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
/* set up our manifest */
mydata = ecalloc(1, sizeof(phar_archive_data));
mydata->fname = expand_filepath(fname, NULL);
if (mydata->fname == NULL) {
return FAILURE;
}
fname_len = strlen(mydata->fname);
#ifdef PHP_WIN32
phar_unixify_path_separators(mydata->fname, fname_len);
+6 -1
View File
@@ -762,7 +762,12 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /*
header.typeflag = entry->tar_type;
if (entry->link) {
strncpy(header.linkname, entry->link, strlen(entry->link));
if (strlcpy(header.linkname, entry->link, sizeof(header.linkname)) >= sizeof(header.linkname)) {
if (fp->error) {
spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, link \"%s\" is too long for format", entry->phar->fname, entry->link);
}
return ZEND_HASH_APPLY_STOP;
}
}
strncpy(header.magic, "ustar", sizeof("ustar")-1);
+3 -2
View File
@@ -13,5 +13,6 @@ DONE
<?php
@unlink(__DIR__."/bug71488.test");
?>
--EXPECT--
DONE
--EXPECTF--
Fatal error: Uncaught BadMethodCallException: tar-based phar "%s/bug71488.test" cannot be created, link "%s" is too long for format in %sbug71488.php:%d
Stack trace:%A
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #77396 Relative filename exceeding maximum path length causes null pointer dereference.
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--FILE--
<?php
$path = '../' . str_repeat("x", PHP_MAXPATHLEN) . '.tar';
$phar = new PharData($path);
?>
--EXPECTF--
Fatal error: Uncaught UnexpectedValueException: Phar creation or opening failed in %s%ebug77396.php:%d
Stack trace:
#0 %s%ebug77396.php(%d): PharData->__construct(%s)
#1 {main}
thrown in %s%ebug77396.php on line %d
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #77586 Symbolic link names in tar-formatted phar must be less than 100 bytes.
--SKIPIF--
<?php if (!extension_loaded("phar") || true /* blocked by bug 65332 */) die("skip"); ?>
--FILE--
<?php
$dir = __DIR__."/bug77586";
$phar = new PharData($dir . "/bug77586.tar");
$phar->buildFromDirectory($dir . "/files");
?>
--CLEAN--
<?php
$dir = __DIR__."/bug77586";
unlink($dir . "/bug77586.tar");
?>
--EXPECTF--
Fatal error: Uncaught PharException: tar-based phar "%s/bug77586.tar" cannot be created, link "%s" is too long for format %s
Stack trace:
#0 %s/bug77586.php(%d): PharData->buildFromDirectory('%s')
#1 {main}
thrown in %s/bug77586.php %s on line %d
+1 -1
View File
@@ -1135,7 +1135,7 @@ SPL_METHOD(SplFileInfo, __construct)
char *path;
size_t len;
if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "s", &path, &len) == FAILURE) {
if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "p", &path, &len) == FAILURE) {
return;
}
+9
View File
@@ -0,0 +1,9 @@
--TEST--
Bug #77431 (SplFileInfo::__construct() accepts NUL bytes)
--FILE--
<?php
new SplFileInfo("bad\0good");
?>
--EXPECTF--
Fatal error: Uncaught TypeError: SplFileInfo::__construct() expects parameter 1 to be a valid path, string given in %s:%d
Stack trace:%A
+6 -6
View File
@@ -1,11 +1,11 @@
/*
/*
DO NOT EDIT THIS FILE!
it has been automaticaly created by php7/scripts/credits from
it has been automaticaly created by php7/scripts/credits from
the information found in the various php7/ext/.../CREDITS and
php7/sapi/.../CREDITS files
if you want to change an entry you have to edit the appropriate
php7/sapi/.../CREDITS files
if you want to change an entry you have to edit the appropriate
CREDITS file instead
*/
@@ -28,7 +28,7 @@ CREDIT_LINE("FTP", "Stefan Esser, Andrew Skalski");
CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger");
CREDIT_LINE("GetText", "Alex Plotnick");
CREDIT_LINE("GNU GMP support", "Stanislav Malyshev");
CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi ");
CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi");
CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky");
CREDIT_LINE("Input Filter", "Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky");
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev, Ard Biesheuvel");
+5 -5
View File
@@ -1,11 +1,11 @@
/*
/*
DO NOT EDIT THIS FILE!
it has been automaticaly created by php7/scripts/credits from
it has been automaticaly created by php7/scripts/credits from
the information found in the various php7/ext/.../CREDITS and
php7/sapi/.../CREDITS files
if you want to change an entry you have to edit the appropriate
php7/sapi/.../CREDITS files
if you want to change an entry you have to edit the appropriate
CREDITS file instead
*/
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 2
#define PHP_RELEASE_VERSION 16
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.2.16-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.2.16"
#define PHP_VERSION_ID 70216
+37 -20
View File
@@ -1168,34 +1168,51 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f
# ifdef EXDEV
if (errno == EXDEV) {
zend_stat_t sb;
# if !defined(ZTS) && !defined(TSRM_WIN32)
/* not sure what to do in ZTS case, umask is not thread-safe */
int oldmask = umask(077);
# endif
int success = 0;
if (php_copy_file(url_from, url_to) == SUCCESS) {
if (VCWD_STAT(url_from, &sb) == 0) {
# ifndef TSRM_WIN32
if (VCWD_CHMOD(url_to, sb.st_mode)) {
if (errno == EPERM) {
php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
VCWD_UNLINK(url_from);
return 1;
}
php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
return 0;
}
success = 1;
# if !defined(TSRM_WIN32)
/*
* Try to set user and permission info on the target.
* If we're not root, then some of these may fail.
* We try chown first, to set proper group info, relying
* on the system environment to have proper umask to not allow
* access to the file in the meantime.
*/
if (VCWD_CHOWN(url_to, sb.st_uid, sb.st_gid)) {
if (errno == EPERM) {
php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
VCWD_UNLINK(url_from);
return 1;
}
php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
return 0;
if (errno != EPERM) {
success = 0;
}
}
if (success) {
if (VCWD_CHMOD(url_to, sb.st_mode)) {
php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
if (errno != EPERM) {
success = 0;
}
}
}
# endif
VCWD_UNLINK(url_from);
return 1;
if (success) {
VCWD_UNLINK(url_from);
}
} else {
php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
}
} else {
php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
}
php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
return 0;
# if !defined(ZTS) && !defined(TSRM_WIN32)
umask(oldmask);
# endif
return success;
}
# endif
#endif