Compare commits

...
18 Commits
Author SHA1 Message Date
Christoph M. Becker b51be55fe5 Update version for PHP 7.3.1 2019-01-08 13:52:49 +00:00
Christoph M. Becker 12583615da Cumulative fix for bugs #77370, #77371, #77381, #77382, #77385 and #77394 2019-01-08 14:16:55 +01:00
Christoph M. Becker 059c720c4c Fix test 2019-01-07 14:59:04 +01:00
Stanislav Malyshev b6fe458ef9 Fix bug #77418 - Heap overflow in utf32be_mbc_to_code
(cherry picked from commit aeec40cb50)
2019-01-07 14:12:57 +01:00
Christoph M. Becker 11ce508ee3 Fix #77367: Negative size parameter in mb_split
When adding the last element to the result value of `mb_split`, the
`chunk_pos` may point beyond the end of the string, in which case the
unsigned `n` would underflow.  Therefore, we check whether this is the
case in the first place, and only calculate `n` otherwise.  Since `n`
is no longer used outside the block, we move its declaration inside.

(cherry picked from commit e617f03066)
2019-01-07 13:46:49 +01:00
Christoph M. Becker a15af81b5f Fix #77270: imagecolormatch Out Of Bounds Write on Heap
At least some of the image reading functions may return images which
use color indexes greater than or equal to im->colorsTotal.  We cater
to this by always using a buffer size which is sufficient for
`gdMaxColors` in `gdImageColorMatch()`.

(cherry picked from commit 7a12dad4dd)
2019-01-07 13:41:51 +01:00
Stanislav Malyshev 027f68ff10 Fix bug #77380 (Global out of bounds read in xmlrpc base64 code)
(cherry picked from commit 1cc2182bcc)
2019-01-07 13:41:05 +01:00
Christoph M. Becker c1edfc748b Fix #77269: Potential unsigned underflow in gdImageScale
Belatedly, we're porting the respective upstream patch[1].

[1] <https://github.com/libgd/libgd/commit/60bfb401ad5a4a8ae995dcd36372fe15c71e1a35>

(cherry picked from commit a918020c03)
2019-01-07 13:26:24 +01:00
Stanislav Malyshev 9d388b95c5 Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
(cherry picked from commit 428d8164ff)
2019-01-07 13:22:23 +01:00
Stanislav Malyshev ba3d1956eb Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
(cherry picked from commit 4fc0bceb7c)
2019-01-07 13:18:57 +01:00
Christoph M. Becker 4371c1a8b5 Fix release date in NEWS 2019-01-07 13:06:07 +01:00
Nikita Popov 6786a31b32 Disable ifuncs on FreeBSD
Intended as at least a preliminary fix for bug #77284. If/when we
figure out what exactly the issue is, we can relax this.

(cherry picked from commit 291589114a)
2019-01-07 13:03:58 +01:00
Christoph M. Becker fcbc05770e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Regenerate certs for openssl tests

(cherry picked from commit b051ab56dc)
2019-01-07 13:03:02 +01:00
Nikita Popov d0ccbfbe43 Fix invalid efree in browscap
Related to bug #77338.

(cherry picked from commit 64de5bc224)
2019-01-07 13:02:13 +01:00
Lauri Kenttä f45ed833d1 Fix #77360: class_uses causes segfault
(cherry picked from commit 16c62a8179)
2019-01-07 13:01:39 +01:00
Lauri Kenttä 7d638d0880 Fix #77359: spl_autoload causes segfault
Use the correct function to free the string.

(cherry picked from commit 89bf3df67d)
2019-01-07 13:00:36 +01:00
Christoph M. Becker 7f54a153ff [ci skip] Add missing NEWS entry for bug 77020 2018-12-18 23:27:35 +01:00
Christoph M. Becker 809d27a06b Update version for PHP 7.3.1RC1 2018-12-18 10:54:20 +00:00
38 changed files with 389 additions and 78 deletions

No files matched your search

+31 -1
View File
@@ -1,6 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.3.1
10 Jan 2019, PHP 7.3.1
- Core:
. Fixed bug #76654 (Build failure on Mac OS X on 32-bit Intel). (Ryandesign)
@@ -27,6 +27,23 @@ PHP NEWS
. Fixed bug #77198 (auto cropping has insufficient precision). (cmb)
. Fixed bug #77200 (imagecropauto(…, GD_CROP_SIDES) crops left but not right).
(cmb)
. Fixed bug #77269 (efree() on uninitialized Heap data in imagescale leads to
use-after-free). (cmb)
. Fixed bug #77270 (imagecolormatch Out Of Bounds Write on Heap). (cmb)
- MBString:
. Fixed bug #77367 (Negative size parameter in mb_split). (Stas)
. Fixed bug #77370 (Buffer overflow on mb regex functions - fetch_token).
(Stas)
. Fixed bug #77371 (heap buffer overflow in mb regex functions -
compile_string_node). (Stas)
. Fixed bug #77381 (heap buffer overflow in multibyte match_at). (Stas)
. Fixed bug #77382 (heap buffer overflow due to incorrect length in
expand_case_fold_string). (Stas)
. Fixed bug #77385 (buffer overflow in fetch_token). (Stas)
. Fixed bug #77394 (Buffer overflow in multibyte case folding - unicode).
(Stas)
. Fixed bug #77418 (Heap overflow in utf32be_mbc_to_code). (Stas)
- OCI8:
. Fixed bug #76804 (oci_pconnect with OCI_CRED_EXT not working). (KoenigsKind)
@@ -46,6 +63,10 @@ PHP NEWS
. Handle invalid index passed to PDOStatement::fetchColumn() as error. (Sergei
Morozov)
- Phar:
. Fixed bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext).
(Stas)
- Soap:
. Fixed bug #77088 (Segfault when using SoapClient with null options).
(Laruence)
@@ -57,9 +78,17 @@ PHP NEWS
- Sodium:
. Fixed bug #77297 (SodiumException segfaults on PHP 7.3). (Nikita, Scott)
- SPL:
. Fixed bug #77359 (spl_autoload causes segfault). (Lauri Kenttä)
. Fixed bug #77360 (class_uses causes segfault). (Lauri Kenttä)
- SQLite3:
. Fixed bug #77051 (Issue with re-binding on SQLite3). (BohwaZ)
- Xmlrpc:
. Fixed bug #77242 (heap out of bounds read in xmlrpc_decode()). (cmb)
. Fixed bug #77380 (Global out of bounds read in xmlrpc base64 code). (Stas)
06 Dec 2018, PHP 7.3.0
- Core:
@@ -217,6 +246,7 @@ PHP NEWS
- IMAP:
. Fixed bug #77153 (imap_open allows to run arbitrary shell commands via
mailbox parameter). (Stas)
. Fixed bug #77020 (null pointer dereference in imap_mail). (cmb)
- Interbase:
. Fixed bug #75453 (Incorrect reflection for ibase_[p]connect). (villfa)
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.3.1-dev"
#define ZEND_VERSION "3.3.1"
#define ZEND_ENGINE_3
+5 -2
View File
@@ -108,7 +108,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=1
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`
@@ -585,7 +585,10 @@ PHP_SOCKADDR_CHECKS
dnl Checks for GCC function attributes on all systems except ones without glibc
dnl Fix for these systems is already included in GCC 7, but not on GCC 6
AS_CASE([$host_alias], [*-*-*android*|*-*-*uclibc*|*-*-*musl*], [true], [
dnl
dnl At least some versions of FreeBSD seem to have buggy ifunc support, see
dnl bug #77284. Conservatively don't use ifuncs on FreeBSD.
AS_CASE([$host_alias], [*-*-*android*|*-*-*uclibc*|*-*-*musl*|*freebsd*], [true], [
AX_GCC_FUNC_ATTRIBUTE([ifunc])
AX_GCC_FUNC_ATTRIBUTE([target])
])
+2 -2
View File
@@ -33,8 +33,8 @@ int gdImageColorMatch (gdImagePtr im1, gdImagePtr im2)
return -4; /* At least 1 color must be allocated */
}
buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * im2->colorsTotal, 0);
memset( buf, 0, sizeof(unsigned long) * 5 * im2->colorsTotal );
buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * gdMaxColors, 0);
memset( buf, 0, sizeof(unsigned long) * 5 * gdMaxColors );
for (x=0; x<im1->sx; x++) {
for( y=0; y<im1->sy; y++ ) {
+9 -9
View File
@@ -890,8 +890,13 @@ static inline LineContribType * _gdContributionsAlloc(unsigned int line_length,
{
unsigned int u = 0;
LineContribType *res;
int overflow_error = 0;
size_t weights_size;
if (overflow2(windows_size, sizeof(double))) {
return NULL;
} else {
weights_size = windows_size * sizeof(double);
}
res = (LineContribType *) gdMalloc(sizeof(LineContribType));
if (!res) {
return NULL;
@@ -908,15 +913,10 @@ static inline LineContribType * _gdContributionsAlloc(unsigned int line_length,
return NULL;
}
for (u = 0 ; u < line_length ; u++) {
if (overflow2(windows_size, sizeof(double))) {
overflow_error = 1;
} else {
res->ContribRow[u].Weights = (double *) gdMalloc(windows_size * sizeof(double));
}
if (overflow_error == 1 || res->ContribRow[u].Weights == NULL) {
res->ContribRow[u].Weights = (double *) gdMalloc(weights_size);
if (res->ContribRow[u].Weights == NULL) {
unsigned int i;
u--;
for (i=0;i<=u;i++) {
for (i=0;i<u;i++) {
gdFree(res->ContribRow[i].Weights);
}
gdFree(res->ContribRow);
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #77269 (Potential unsigned underflow in gdImageScale)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
--INI--
memory_limit=2G
--FILE--
<?php
$im = imagecreate(2**28, 1);
if(is_resource($im)) {
imagescale($im, 1, 1, IMG_TRIANGLE);
}
?>
===DONE===
--EXPECTF--
Warning: imagescale():%S product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
in %s on line %d
===DONE===
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #77270 (imagecolormatch Out Of Bounds Write on Heap)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream bugfix has not been released');
?>
--FILE--
<?php
$img1 = imagecreatetruecolor(0xfff, 0xfff);
$img2 = imagecreate(0xfff, 0xfff);
imagecolorallocate($img2, 0, 0, 0);
imagesetpixel($img2, 0, 0, 255);
imagecolormatch($img1, $img2);
?>
===DONE===
--EXPECT--
===DONE===
+5 -5
View File
@@ -540,13 +540,13 @@ compile_length_string_node(Node* node, regex_t* reg)
ambig = NODE_STRING_IS_AMBIG(node);
p = prev = sn->s;
prev_len = enclen(enc, p);
SAFE_ENC_LEN(enc, p, sn->end, prev_len);
p += prev_len;
slen = 1;
rlen = 0;
for (; p < sn->end; ) {
len = enclen(enc, p);
SAFE_ENC_LEN(enc, p, sn->end, len);
if (len == prev_len) {
slen++;
}
@@ -591,12 +591,12 @@ compile_string_node(Node* node, regex_t* reg)
ambig = NODE_STRING_IS_AMBIG(node);
p = prev = sn->s;
prev_len = enclen(enc, p);
SAFE_ENC_LEN(enc, p, end, prev_len);
p += prev_len;
slen = 1;
for (; p < end; ) {
len = enclen(enc, p);
SAFE_ENC_LEN(enc, p, end, len);
if (len == prev_len) {
slen++;
}
@@ -3624,7 +3624,7 @@ expand_case_fold_string(Node* node, regex_t* reg)
goto err;
}
len = enclen(reg->enc, p);
SAFE_ENC_LEN(reg->enc, p, end, len);
if (n == 0) {
if (IS_NULL(snode)) {
+6 -1
View File
@@ -393,14 +393,17 @@ save_entry(ScanEnv* env, enum SaveType type, int* id)
c = ONIGENC_MBC_TO_CODE(enc, p, end); \
pfetch_prev = p; \
p += ONIGENC_MBC_ENC_LEN(enc, p); \
if(UNEXPECTED(p > end)) p = end; \
} while (0)
#define PINC_S do { \
p += ONIGENC_MBC_ENC_LEN(enc, p); \
if(UNEXPECTED(p > end)) p = end; \
} while (0)
#define PFETCH_S(c) do { \
c = ONIGENC_MBC_TO_CODE(enc, p, end); \
p += ONIGENC_MBC_ENC_LEN(enc, p); \
if(UNEXPECTED(p > end)) p = end; \
} while (0)
#define PPEEK (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE)
@@ -5409,7 +5412,9 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->u.code = c2;
}
else { /* string */
p = tok->backp + enclen(enc, tok->backp);
int len;
SAFE_ENC_LEN(enc, tok->backp, end, len);
p = tok->backp + len;
}
}
break;
+12
View File
@@ -455,4 +455,16 @@ extern int onig_global_callout_names_free(void);
extern int onig_print_names(FILE*, regex_t*);
#endif
#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
# define UNEXPECTED(condition) __builtin_expect(condition, 0)
#else
# define UNEXPECTED(condition) (condition)
#endif
#define SAFE_ENC_LEN(enc, p, end, res) do { \
int __res = enclen(enc, p); \
if (UNEXPECTED(p + __res > end)) __res = end - p; \
res = __res; \
} while(0);
#endif /* REGPARSE_H */
+3 -1
View File
@@ -128,16 +128,18 @@ utf16be_is_mbc_newline(const UChar* p, const UChar* end)
}
static OnigCodePoint
utf16be_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED)
utf16be_mbc_to_code(const UChar* p, const UChar* end)
{
OnigCodePoint code;
if (UTF16_IS_SURROGATE_FIRST(*p)) {
if (end - p < 4) return 0;
code = ((((p[0] - 0xd8) << 2) + ((p[1] & 0xc0) >> 6) + 1) << 16)
+ ((((p[1] & 0x3f) << 2) + (p[2] - 0xdc)) << 8)
+ p[3];
}
else {
if (end - p < 2) return 0;
code = p[0] * 256 + p[1];
}
return code;
+2 -1
View File
@@ -141,13 +141,14 @@ utf16le_is_mbc_newline(const UChar* p, const UChar* end)
}
static OnigCodePoint
utf16le_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED)
utf16le_mbc_to_code(const UChar* p, const UChar* end)
{
OnigCodePoint code;
UChar c0 = *p;
UChar c1 = *(p+1);
if (UTF16_IS_SURROGATE_FIRST(c1)) {
if (end - p < 4) return 0;
code = ((((c1 - 0xd8) << 2) + ((c0 & 0xc0) >> 6) + 1) << 16)
+ ((((c0 & 0x3f) << 2) + (p[3] - 0xdc)) << 8)
+ p[2];
+1
View File
@@ -67,6 +67,7 @@ utf32be_is_mbc_newline(const UChar* p, const UChar* end)
static OnigCodePoint
utf32be_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED)
{
if (end - p < 4) return 0;
return (OnigCodePoint )(((p[0] * 256 + p[1]) * 256 + p[2]) * 256 + p[3]);
}
+1
View File
@@ -67,6 +67,7 @@ utf32le_is_mbc_newline(const UChar* p, const UChar* end)
static OnigCodePoint
utf32le_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED)
{
if (end - p < 4) return 0;
return (OnigCodePoint )(((p[3] * 256 + p[2]) * 256 + p[1]) * 256 + p[0]);
}
+2 -3
View File
@@ -1238,7 +1238,6 @@ PHP_FUNCTION(mb_split)
size_t string_len;
int err;
size_t n;
zend_long count = -1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &arg_pattern, &arg_pattern_len, &string, &string_len, &count) == FAILURE) {
@@ -1296,8 +1295,8 @@ PHP_FUNCTION(mb_split)
}
/* otherwise we just have one last element to add to the array */
n = ((OnigUChar *)(string + string_len) - chunk_pos);
if (n > 0) {
if ((OnigUChar *)(string + string_len) > chunk_pos) {
size_t n = ((OnigUChar *)(string + string_len) - chunk_pos);
add_next_index_stringl(return_value, (char *)chunk_pos, n);
} else {
add_next_index_stringl(return_value, "", 0);
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #77367 (Negative size parameter in mb_split)
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('mbstring extension not available');
if (!function_exists('mb_split')) die('mb_split() not available');
?>
--FILE--
<?php
mb_regex_encoding('UTF-8');
var_dump(mb_split("\\w", "\xfc"));
?>
===DONE===
--EXPECT--
array(2) {
[0]=>
string(0) ""
[1]=>
string(0) ""
}
===DONE===
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #77370 (Buffer overflow on mb regex functions - fetch_token)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
var_dump(mb_split(" \xfd",""));
?>
--EXPECTF--
Warning: mb_split(): mbregex compile err: invalid code point value in %sbug77370.php on line %d
bool(false)
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
var_dump(mb_ereg("()0\xfc00000\xfc00000\xfc00000\xfc",""));
?>
--EXPECTF--
Warning: mb_ereg(): mbregex compile err: invalid code point value in %sbug77371.php on line %d
bool(false)
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #77381 (heap buffer overflow in multibyte match_at)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
var_dump(mb_ereg("000||0\xfa","0"));
var_dump(mb_ereg("(?i)000000000000000000000\xf0",""));
var_dump(mb_ereg("0000\\"."\xf5","0"));
var_dump(mb_ereg("(?i)FFF00000000000000000\xfd",""));
?>
--EXPECTF--
Warning: mb_ereg(): mbregex compile err: invalid code point value in %sbug77381.php on line %d
bool(false)
Warning: mb_ereg(): mbregex compile err: invalid code point value in %sbug77381.php on line %d
bool(false)
Warning: mb_ereg(): mbregex compile err: invalid code point value in %sbug77381.php on line %d
bool(false)
Warning: mb_ereg(): mbregex compile err: invalid code point value in %sbug77381.php on line %d
bool(false)
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #77371 (Heap overflow in utf32be_mbc_to_code)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
mb_regex_encoding("UTF-32");
var_dump(mb_split("\x00\x00\x00\x5c\x00\x00\x00B","000000000000000000000000000000"));
?>
--EXPECT--
array(1) {
[0]=>
string(30) "000000000000000000000000000000"
}
+27 -27
View File
@@ -1,35 +1,35 @@
-----BEGIN CERTIFICATE-----
MIIGAzCCA+ugAwIBAgIUVL06vQzqQ1uRdJ7NAAZyylsKOpYwDQYJKoZIhvcNAQEL
MIIGAzCCA+ugAwIBAgIUZ7ZvvfVqSEf1EswMT9LfMIPc/U8wDQYJKoZIhvcNAQEL
BQAwgZAxCzAJBgNVBAYTAlBUMQ8wDQYDVQQIDAZMaXNib2ExDzANBgNVBAcMBkxp
c2JvYTEXMBUGA1UECgwOUEhQIEZvdW5kYXRpb24xHjAcBgNVBAMMFVJvb3QgQ0Eg
Zm9yIFB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r
xz09wYYW3HJpR+QKPCfJ79JxDhuMHMoUOpIy8vGFnt5zVTcFLa378Sy3vCT1Qwvt
tTavFGHby4A7OqT6xu+9GTW37OaiV91UelLLV0+MoR4XiMVMX76mvqzmKCp6L9ae
7RYHrrCtNxkYUKUSkOEc2VHnT+sENkJIZu7zzN7/QNlc0yE9Rtsmgy4QAxo2m9u0
pUZLAulZ1lS7g/sr7/8Pp17RDvJiJh+oAPyVYZ7OoLF1IoHDHcZI0bqcqhDhiHZs
PXYqyMCxyYzHFOAOgvbrEkmp8z/E8ATVwdUbAYN1dMrYHre1P4HFEtJh2QiGG2KE
4jheuNhH1R25AizbwYbD33Kdp7ltCgBlfYqjl771SlgY45QYs0mUdc1Pv39SGIwf
ZUm7mOWjaTBdYANrkvGM5NNT9kESjKkWykyTg4UF5rHV6nlyexR4b3fjabroi4BS
v6w=
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQC1QBVApOClQ+C0U4nfDeQMkRNLjm1Z5P3qRSDU15gspb6M1sWH
+42
View File
@@ -7,6 +7,48 @@ if (!function_exists("proc_open")) die("skip no proc_open");
?>
--FILE--
<?php
/*
How to generate bug54992.pem and bug54992-ca.pem and all dependants:
All the commands below assume you're in the root of php sources
Generate new key for CA:
$ openssl genrsa -out ./ext/openssl/tests/bug54992-ca.key 4096
Create new CA:
$ openssl req -new -x509 -key ./ext/openssl/tests/bug54992-ca.key \
-out ext/openssl/tests/bug54992-ca.pem \
-subj '/C=PT/ST=Lisboa/L=Lisboa/O=PHP Foundation/CN=Root CA for PHP Tests/emailAddress=internals@lists.php.net' \
-days 400
Extract private key from the bundle:
$ openssl rsa -in ext/openssl/tests/bug54992.pem > ext/openssl/tests/bug54992.key
Extract CSR from existing certificate:
$ openssl x509 -x509toreq -in ext/openssl/tests/bug54992.pem -out ext/openssl/tests/bug54992.csr -signkey ext/openssl/tests/bug54992.key
Sign the CSR:
$ openssl x509 -CA ext/openssl/tests/bug54992-ca.pem \
-CAcreateserial \
-CAkey ./ext/openssl/tests/bug54992-ca.key \
-req \
-in ext/openssl/tests/bug54992.csr \
-sha256 \
-days 400 \
-out ./ext/openssl/tests/bug54992.pem
Bundle certificate's private key with the certificate:
$ cat ext/openssl/tests/bug54992.key >> ext/openssl/tests/bug54992.pem\
Dependants:
1. ext/openssl/tests/bug65538_003.phpt
Run the following to generate required phar:
php -d phar.readonly=Off -r '$phar = new Phar("ext/openssl/tests/bug65538.phar"); $phar->addFile("ext/openssl/tests/bug54992.pem", "bug54992.pem"); $phar->addFile("ext/openssl/tests/bug54992-ca.pem", "bug54992-ca.pem");'
2. Update ext/openssl/tests/openssl_peer_fingerprint_basic.phpt (see instructions in there)
*/
$serverCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
Binary file not shown.
@@ -33,12 +33,17 @@ $clientCode = <<<'CODE'
phpt_wait();
// should be: 3610606deda596b3ae3859d33c4ce1d9
stream_context_set_option($clientCtx, 'ssl', 'peer_fingerprint', '3610606deda596b3ae3859d33c4ce1da');
// Run the following to get actual md5 (from sources root):
// openssl x509 -noout -fingerprint -md5 -inform pem -in ext/openssl/tests/bug54992.pem | cut -d '=' -f 2 | tr -d ':' | tr 'A-F' 'a-f'
// Currently it's 4edbbaf40a6a4b6af22b6d6d9818378f
// One below is intentionally broken (compare the last character):
stream_context_set_option($clientCtx, 'ssl', 'peer_fingerprint', '4edbbaf40a6a4b6af22b6d6d98183780');
var_dump(stream_socket_client($serverUri, $errno, $errstr, 2, $clientFlags, $clientCtx));
// Run the following to get actual sha256 (from sources root):
// openssl x509 -noout -fingerprint -sha256 -inform pem -in ext/openssl/tests/bug54992.pem | cut -d '=' -f 2 | tr -d ':' | tr 'A-F' 'a-f'
stream_context_set_option($clientCtx, 'ssl', 'peer_fingerprint', [
'sha256' => 'dffa72247ab7e44d94b2858528e3f67015925782148d2cf0b15cd82d1c931215',
'sha256' => 'b1d480a2f83594fa243d26378cf611f334d369e59558d87e3de1abe8f36cb997',
]);
var_dump(stream_socket_client($serverUri, $errno, $errstr, 2, $clientFlags, $clientCtx));
CODE;
+1 -1
View File
@@ -2026,7 +2026,7 @@ next_extension:
}
while (pos != filename && (*(pos - 1) == '/' || *(pos - 1) == '\0')) {
pos = memchr(pos + 1, '.', filename_len - (pos - filename) + 1);
pos = memchr(pos + 1, '.', filename_len - (pos - filename) - 1);
if (!pos) {
return FAILURE;
}
+14
View File
@@ -0,0 +1,14 @@
--TEST--
PHP bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--FILE--
<?php
try {
var_dump(new Phar('a/.b', 0,'test.phar'));
} catch(UnexpectedValueException $e) {
echo "OK";
}
?>
--EXPECT--
OK
+2 -2
View File
@@ -69,7 +69,7 @@ static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autol
zend_string *lc_name = zend_string_tolower(name);
ce = zend_hash_find_ptr(EG(class_table), lc_name);
zend_string_free(lc_name);
zend_string_release(lc_name);
} else {
ce = zend_lookup_class(name);
}
@@ -335,7 +335,7 @@ PHP_FUNCTION(spl_autoload)
pos = pos1 ? pos1 + 1 : NULL;
pos_len = pos1? pos_len - pos1_len - 1 : 0;
}
zend_string_free(lc_name);
zend_string_release(lc_name);
} /* }}} */
/* {{{ proto string spl_autoload_extensions([string file_extensions])
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #77359: spl_autoload causes segfault
--FILE--
<?php
$str = "foo";
$str .= "bar";
spl_autoload($str);
spl_autoload($str);
var_dump($str);
?>
--EXPECT--
string(6) "foobar"
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #77360: class_uses causes segfault
--FILE--
<?php
class foobar {}
$str = "foo";
$str .= "bar";
var_dump(class_uses($str, false));
var_dump(class_uses($str, false));
var_dump($str);
?>
--EXPECT--
array(0) {
}
array(0) {
}
string(6) "foobar"
+1 -1
View File
@@ -755,7 +755,7 @@ PHP_FUNCTION(get_browser)
found_entry = zend_hash_str_find_ptr(bdata->htab,
DEFAULT_SECTION_NAME, sizeof(DEFAULT_SECTION_NAME)-1);
if (found_entry == NULL) {
efree(lookup_browser_name);
zend_string_release(lookup_browser_name);
RETURN_FALSE;
}
}
@@ -0,0 +1,2 @@
[Firefox]
Browser="Firefox"
@@ -0,0 +1,12 @@
--TEST--
get_browser() without a default
--INI--
browscap={PWD}/browscap_no_default.ini
--FILE--
<?php
var_dump(get_browser(""));
?>
--EXPECT--
bool(false)
+2 -2
View File
@@ -74,7 +74,7 @@ void base64_encode_xmlrpc(struct buffer_st *b, const char *source, int length)
while (!hiteof) {
unsigned char igroup[3], ogroup[4];
int c, n;
int c, n;
igroup[0] = igroup[1] = igroup[2] = 0;
for (n = 0; n < 3; n++) {
@@ -166,7 +166,7 @@ void base64_decode_xmlrpc(struct buffer_st *bfr, const char *source, int length)
return;
}
if (dtable[c] & 0x80) {
if (dtable[(unsigned char)c] & 0x80) {
/*
fprintf(stderr, "Offset %i length %i\n", offset, length);
fprintf(stderr, "character '%c:%x:%c' in input file.\n", c, c, dtable[c]);
+3
View File
@@ -720,6 +720,9 @@ xml_element* xml_elem_parse_buf(const char* in_buf, int len, XML_ELEM_INPUT_OPTI
long byte_idx = XML_GetCurrentByteIndex(parser);
/* int byte_total = XML_GetCurrentByteCount(parser); */
const char * error_str = XML_ErrorString(err_code);
if(byte_idx > len) {
byte_idx = len;
}
if(byte_idx >= 0) {
snprintf(buf,
sizeof(buf),
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #77242 (heap out of bounds read in xmlrpc_decode())
--SKIPIF--
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
--FILE--
<?php
var_dump(xmlrpc_decode(base64_decode("PD94bWwgdmVyc2lvbmVuY29kaW5nPSJJU084ODU5NyKkpKSkpKSkpKSkpKSkpKSkpKSkpKSk")));
?>
--EXPECT--
NULL
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #77380 (Global out of bounds read in xmlrpc base64 code)
--SKIPIF--
<?php
if (!extension_loaded("xmlrpc")) print "skip";
?>
--FILE--
<?php
var_dump(xmlrpc_decode(base64_decode("PGJhc2U2ND7CkzwvYmFzZTY0Pgo=")));
?>
--EXPECT--
object(stdClass)#1 (2) {
["scalar"]=>
string(0) ""
["xmlrpc_type"]=>
string(6) "base64"
}
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 3
#define PHP_RELEASE_VERSION 1
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.3.1-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.3.1"
#define PHP_VERSION_ID 70301