summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2019-03-15 16:58:08 +0800
committerXinchen Hui <laruence@gmail.com>2019-03-15 16:58:08 +0800
commitb41959089313d7397c936a885e9d1ca84e0f93f8 (patch)
tree630096e11c0286e115c98142090cb385147545e0
parent217c05da527bcbc8230b96e236ae687447409936 (diff)
downloadphp-git-b41959089313d7397c936a885e9d1ca84e0f93f8.tar.gz
Fixed bug #77697 (Crash on Big_Endian platform)
-rw-r--r--NEWS3
-rw-r--r--ext/phar/util.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 09dbf64b56..f9d637f3e5 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 7721a4e37c..d05f8ca5cd 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);