com php-src: Merge branch 'PHP-5.6' into PHP-7.0: NEWS ext/gd/gd.c

From: Date: Sun, 21 Aug 2016 17:48:38 +0000
Subject: com php-src: Merge branch 'PHP-5.6' into PHP-7.0: NEWS ext/gd/gd.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-94038@lists.php.net to get a copy of this message
Commit: 4c13a7f5c4d0fcbfdd6cd60d84bc88f7c34bfb4f Author: Christoph M. Becker <cmbecker69@gmx.de> Sun, 21 Aug 2016 19:43:17 +0200 Parents: 4c68fc5392f176434ebadb80cf451498009cc62a 6a232c3604f6c00f6c09cc3782dd1b36b30d23d4 Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4c13a7f5c4d0fcbfdd6cd60d84bc88f7c34bfb4f Log: Merge branch 'PHP-5.6' into PHP-7.0 Changed paths: MM NEWS MM ext/gd/gd.c Diff: diff --cc NEWS index 7cd7680,a2b3aad..20e24b4 --- a/NEWS +++ b/NEWS @@@ -20,22 -18,15 +20,23 @@@ PH images). (cmb) . Fixed bug #72913 (imagecopy() loses single-color transparency on palette images). (cmb) + . Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb) -- JSON: - . Fixed bug #72787 (json_decode reads out of bounds). (Jakub Zelenka) +- IMAP: + . Fixed bug #72852 (imap_mail null dereference). (Anatol) + +- Intl: + . Fixed bug #65732 (grapheme_*() is not Unicode compliant on CR LF + sequence). (cmb) -- MSSQL: - . Fixed bug #72039 (Use of uninitialised value on mssql_guid_string).. (Kalle) +- OCI8 + . Fixed invalid handle error with Implicit Result Sets. (Chris Jones) + . Fixed bug #72524 (Binding null values triggers ORA-24816 error). (Chris Jones) - PDO: + . Fixed bug #72788 (Invalid memory access when using persistent PDO + connection). (Keyur) + . Fixed bug #72791 (Memory leak in PDO persistent connection handling). (Keyur) . Fixed bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY returns false). (cmb) diff --cc ext/gd/gd.c index 0346a74,afd3765..462029c --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@@ -4070,7 -4529,8 +4070,8 @@@ static void _php_image_convert(INTERNAL /* Open destination file */ dest = VCWD_FOPEN(fn_dest, "wb"); if (!dest) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn_dest); + php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn_dest); + fclose(org); RETURN_FALSE; } @@@ -4078,7 -4538,9 +4079,9 @@@ case PHP_GDIMG_TYPE_GIF: im_org = gdImageCreateFromGif(org); if (im_org == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest); + php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest); + fclose(org); + fclose(dest); RETURN_FALSE; } break; @@@ -4088,7 -4550,9 +4091,9 @@@ ignore_warning = INI_INT("gd.jpeg_ignore_warning"); im_org = gdImageCreateFromJpegEx(org, ignore_warning); if (im_org == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest); + php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest); + fclose(org); + fclose(dest); RETURN_FALSE; } break; @@@ -4098,14 -4562,18 +4103,18 @@@ case PHP_GDIMG_TYPE_PNG: im_org = gdImageCreateFromPng(org); if (im_org == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest); + php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest); + fclose(org); + fclose(dest); RETURN_FALSE; } break; #endif /* HAVE_GD_PNG */ default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Format not supported"); + php_error_docref(NULL, E_WARNING, "Format not supported"); + fclose(org); + fclose(dest); RETURN_FALSE; break; } @@@ -4139,7 -4609,9 +4150,9 @@@ im_tmp = gdImageCreate (dest_width, dest_height); if (im_tmp == NULL ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer"); + php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer"); + fclose(dest); + gdImageDestroy(im_org); RETURN_FALSE; } @@@ -4147,23 -4619,29 +4160,29 @@@ gdImageDestroy(im_org); - fclose(org); - im_dest = gdImageCreate(dest_width, dest_height); if (im_dest == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate destination buffer"); + php_error_docref(NULL, E_WARNING, "Unable to allocate destination buffer"); + fclose(dest); + gdImageDestroy(im_tmp); RETURN_FALSE; } white = gdImageColorAllocate(im_dest, 255, 255, 255); if (white == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); + php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer"); + fclose(dest); + gdImageDestroy(im_tmp); + gdImageDestroy(im_dest); RETURN_FALSE; } black = gdImageColorAllocate(im_dest, 0, 0, 0); if (black == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); + php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer"); + fclose(dest); + gdImageDestroy(im_tmp); + gdImageDestroy(im_dest); RETURN_FALSE; }

« previous php.cvs (#94038) next »