com php-src: Fixed bug #77697 (Crash on Big_Endian platform ): NEWS ext/phar/util.c

From: Date: Fri, 15 Mar 2019 08:58:08 +0000
Subject: com php-src: Fixed bug #77697 (Crash on Big_Endian platform ): NEWS ext/phar/util.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-105153@lists.php.net to get a copy of this message
Commit: b41959089313d7397c936a885e9d1ca84e0f93f8 Author: Xinchen Hui <laruence@gmail.com> Fri, 15 Mar 2019 16:58:08 +0800 Parents: 217c05da527bcbc8230b96e236ae687447409936 Branches: PHP-7.3 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b41959089313d7397c936a885e9d1ca84e0f93f8 Log: Fixed bug #77697 (Crash on Big_Endian platform) Bugs: https://bugs.php.net/77697 Changed paths: M NEWS M ext/phar/util.c Diff: diff --git a/NEWS b/NEWS index 09dbf64..f9d637f 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,9 @@ PHP NEWS - MySQLi: . Fixed bug #77597 (mysqli_fetch_field hangs scripts). (Nikita) +- Phar: + . Fxied bug #77697 (Crash on Big_Endian platform). (Laruence) + - sodium: . Fixed bug #77646 (sign_detached() strings not terminated). (Frank) diff --git a/ext/phar/util.c b/ext/phar/util.c index 7721a4e..d05f8ca 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -1829,9 +1829,9 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat return FAILURE; #endif case PHAR_SIG_OPENSSL: { - size_t siglen; unsigned char *sigbuf; #ifdef PHAR_HAVE_OPENSSL + unsigned int siglen; BIO *in; EVP_PKEY *key; EVP_MD_CTX *md_ctx; @@ -1878,7 +1878,7 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat } } - if (!EVP_SignFinal (md_ctx, sigbuf,(unsigned int *)&siglen, key)) { + if (!EVP_SignFinal (md_ctx, sigbuf, &siglen, key)) { efree(sigbuf); if (error) { spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); @@ -1889,6 +1889,7 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat sigbuf[siglen] = '\0'; EVP_MD_CTX_destroy(md_ctx); #else + size_t siglen; sigbuf = NULL; siglen = 0; php_stream_seek(fp, 0, SEEK_END);

« previous php.cvs (#105153) next »