diff options
author | ULF WENDEL <uw@php.net> | 2012-10-23 13:16:12 +0200 |
---|---|---|
committer | ULF WENDEL <uw@php.net> | 2012-10-23 13:16:12 +0200 |
commit | 38b632dd7c1d6a935f859e53d69cc3ce3c373c94 (patch) | |
tree | befeed2d1a27d9b0a7f80bf302694170e79f16c0 | |
parent | 77fd708a0b81bf6dfcfce6aba24eaa606b97f630 (diff) | |
parent | f962260081c4341c768533c5fb23c83c6ca9b1ed (diff) | |
download | php-git-38b632dd7c1d6a935f859e53d69cc3ce3c373c94.tar.gz |
Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src:
merged changes for bug #63297 from 5.3
fixed a typo in the error message
Fixed bug #63297 Phar fails to write an openssl based signature
enabled libxpm for gd on windows
enabled libxpm for gd on windows
Update test script
Test for #63336, xfail now
Fixed bug #63305 (zend_mm_heap corrupted with traits)
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | Zend/tests/bug63305.phpt | 43 | ||||
-rw-r--r-- | Zend/tests/bug63336.phpt | 24 | ||||
-rw-r--r-- | Zend/zend_compile.c | 4 | ||||
-rw-r--r-- | ext/gd/config.w32 | 6 | ||||
-rw-r--r-- | ext/phar/util.c | 26 |
6 files changed, 101 insertions, 9 deletions
@@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2012, PHP 5.4.9 +- Core: + . Fixed bug #63305 (zend_mm_heap corrupted with traits). (Dmitry, Laruence) + - Fileinfo: . Fixed bug #63248 (Load multiple magic files from a directory under Windows). (Anatoliy) @@ -15,6 +18,10 @@ PHP NEWS (Dmitry, Laruence) . Fixed bug #63284 (Upgrade PCRE to 8.31). (Anatoliy) +- Phar: + . Fixed bug #63297 (Phar fails to write an openssl based signature). + (Anatoliy) + 18 Oct 2012, PHP 5.4.8 - CLI server: diff --git a/Zend/tests/bug63305.phpt b/Zend/tests/bug63305.phpt new file mode 100644 index 0000000000..4bd3a4dbeb --- /dev/null +++ b/Zend/tests/bug63305.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #63305 (zend_mm_heap corrupted with traits) +--FILE-- +<?php +new Attachment(""); + +function __autoload($class) { + switch ($class) { + case "Attachment": + eval(<<<'PHP' +class Attachment extends File { +} +PHP + ); + break; + case "File": + eval(<<<'PHP' +class File { + use TDatabaseObject { + TDatabaseObject::__construct as private databaseObjectConstruct; + } + public function __construct() { + } +} +PHP + ); + break; + case "TDatabaseObject": + eval(<<<'PHP' +trait TDatabaseObject { + public function __construct() { + } +} +PHP + ); + break; + } + return TRUE; +} +echo "okey"; +?> +--EXPECT-- +okey diff --git a/Zend/tests/bug63336.phpt b/Zend/tests/bug63336.phpt new file mode 100644 index 0000000000..d2c3d41131 --- /dev/null +++ b/Zend/tests/bug63336.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #63336 (invalid E_NOTICE error occur) +--XFAIL-- +Bug is not fixed yet +--FILE-- +<?php +error_reporting(E_ALL | E_NOTICE ); +define("TEST", "123"); +class Base { + const DUMMY = "XXX"; + public function foo($var=TEST, $more=null) { return true; } + public function bar($more=self::DUMMY) { return true; } +} + +class Child extends Base { + const DUMMY = "DDD"; + public function foo($var=TEST, array $more = array()) { return true; } + public function bar($var, $more=self::DUMMY) { return true; } +} +?> +--EXPECT-- +Strict Standards: Declaration of Child::foo() should be compatible with Base::foo($var = '123', $more = NULL) in %sbug63336.php on line %d + +Strict Standards: Declaration of Child::bar() should be compatible with Base::bar($var, $more = 'XXX') in %sbug63336.php on line %d diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 303eedb6bc..4dd3eaf1ed 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3885,7 +3885,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, /* if it is 0, no modifieres has been changed */ if (aliases[i]->modifiers) { - fn_copy.common.fn_flags = aliases[i]->modifiers; + fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS; if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) { fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC; } @@ -3926,7 +3926,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, && (!aliases[i]->trait_method->ce || fn->common.scope == aliases[i]->trait_method->ce) && (aliases[i]->trait_method->mname_len == fnname_len) && (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { - fn_copy.common.fn_flags = aliases[i]->modifiers; + fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS; if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) { fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC; diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index 38292d52f4..8c932a037c 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -15,7 +15,9 @@ if (PHP_GD != "no") { (CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) && CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) && (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD) )) || - (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) + (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) && + CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11") ) { if (PHP_T1LIB != "no") { if (CHECK_LIB("T1_StaticMD.lib", "gd", PHP_GD) && @@ -56,6 +58,7 @@ if (PHP_GD != "no") { /D HAVE_GD_STRINGTTF=1 \ /D HAVE_GD_WBMP \ /D HAVE_GD_XBM \ +/D HAVE_GD_XPM \ /D HAVE_GD_WEBP \ /D HAVE_LIBFREETYPE=1 \ /D HAVE_LIBGD13=1 \ @@ -65,6 +68,7 @@ if (PHP_GD != "no") { /D HAVE_LIBJPEG \ /D HAVE_LIBVPX \ /D HAVE_LIBPNG \ +/D HAVE_XPM \ /D HAVE_COLORCLOSESTHWB \ /D USE_GD_IMGSTRTTF \ /D USE_GD_IOCTX \ diff --git a/ext/phar/util.c b/ext/phar/util.c index 5fcb2b6573..f674bca4fb 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -2118,8 +2118,7 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat #ifdef PHAR_HAVE_OPENSSL BIO *in; EVP_PKEY *key; - EVP_MD *mdtype = (EVP_MD *) EVP_sha1(); - EVP_MD_CTX md_ctx; + EVP_MD_CTX *md_ctx; in = BIO_new_mem_buf(PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len)); @@ -2140,15 +2139,30 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat return FAILURE; } + md_ctx = EVP_MD_CTX_create(); + siglen = EVP_PKEY_size(key); sigbuf = emalloc(siglen + 1); - EVP_SignInit(&md_ctx, mdtype); + + if (!EVP_SignInit(md_ctx, EVP_sha1())) { + efree(sigbuf); + if (error) { + spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname); + } + return FAILURE; + } while ((sig_len = php_stream_read(fp, (char*)buf, sizeof(buf))) > 0) { - EVP_SignUpdate(&md_ctx, buf, sig_len); + if (!EVP_SignUpdate(md_ctx, buf, sig_len)) { + efree(sigbuf); + if (error) { + spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname); + } + return FAILURE; + } } - if (!EVP_SignFinal (&md_ctx, sigbuf,(unsigned int *)&siglen, key)) { + if (!EVP_SignFinal (md_ctx, sigbuf,(unsigned int *)&siglen, key)) { efree(sigbuf); if (error) { spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); @@ -2157,7 +2171,7 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat } sigbuf[siglen] = '\0'; - EVP_MD_CTX_cleanup(&md_ctx); + EVP_MD_CTX_destroy(md_ctx); #else sigbuf = NULL; siglen = 0; |