mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 11:10:49 +00:00
Compare commits
74
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0822792c8 | ||
|
|
81f23057dc | ||
|
|
c1de84014d | ||
|
|
23b057742e | ||
|
|
1ba3314335 | ||
|
|
b73a108543 | ||
|
|
289cb0f77c | ||
|
|
3462efa386 | ||
|
|
1baeae4270 | ||
|
|
fe3d53f443 | ||
|
|
4371af3e19 | ||
|
|
ee76a5ae5a | ||
|
|
58b0003975 | ||
|
|
a4c55eefd0 | ||
|
|
6e64aba47f | ||
|
|
e2dcf3cc54 | ||
|
|
8dca5ae5ec | ||
|
|
49782c5499 | ||
|
|
06d309fd7a | ||
|
|
b4e4788c44 | ||
|
|
cb981e39c2 | ||
|
|
2885f62816 | ||
|
|
d20bebfe13 | ||
|
|
3db7427b71 | ||
|
|
4698a412bf | ||
|
|
523f230c83 | ||
|
|
1f4b057b63 | ||
|
|
36239fee36 | ||
|
|
67ec3ce1ec | ||
|
|
028507f1f6 | ||
|
|
2881199c80 | ||
|
|
8d6e958867 | ||
|
|
73ca9b3773 | ||
|
|
f6e8ce8121 | ||
|
|
f600785f65 | ||
|
|
ad7ed6fe21 | ||
|
|
787e3a1ee4 | ||
|
|
9839d3a953 | ||
|
|
45ac5edbd9 | ||
|
|
7d06a5c89f | ||
|
|
37acebcc8c | ||
|
|
a7815e63bd | ||
|
|
d37658be6c | ||
|
|
390f64701d | ||
|
|
7991a88675 | ||
|
|
55b880070c | ||
|
|
703be4f77e | ||
|
|
27a743b82b | ||
|
|
bdf7393ddb | ||
|
|
2693e52113 | ||
|
|
4e68b2c52b | ||
|
|
f269cdcd4f | ||
|
|
e46d589624 | ||
|
|
12107d619b | ||
|
|
f7f4fd4706 | ||
|
|
e8b7698f5e | ||
|
|
2aae60461c | ||
|
|
f8c514ba6b | ||
|
|
8dc4f4dc9e | ||
|
|
5f8380d33e | ||
|
|
89637c6b41 | ||
|
|
3eecee16d1 | ||
|
|
0f8cf3b849 | ||
|
|
0e21d8066b | ||
|
|
cf649f59cb | ||
|
|
d2274b01cb | ||
|
|
f1b2afc9d9 | ||
|
|
6477bb724e | ||
|
|
50b38322b9 | ||
|
|
814966ad33 | ||
|
|
0ab1af7d3e | ||
|
|
ad9c552b12 | ||
|
|
7e49e8e797 | ||
|
|
db890956ec |
No files matched your search
@@ -1,3 +1,4 @@
|
||||
dist: precise
|
||||
language: c
|
||||
sudo: false
|
||||
addons:
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fpm
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>, Jerome Loyet <fat@php.net>
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3.3
|
||||
|
||||
@@ -1,12 +1,106 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
05 Jan 2017, PHP 5.6.30RC1
|
||||
13 Sep 2018, PHP 5.6.38
|
||||
|
||||
- Apache2
|
||||
. Fixed bug #76582 (XSS due to the header Transfer-Encoding: chunked). (Stas)
|
||||
|
||||
19 Jul 2018, PHP 5.6.37
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #76423 (Int Overflow lead to Heap OverFlow in
|
||||
exif_thumbnail_extract of exif.c). (Stas)
|
||||
. Fixed bug #76557 (heap-buffer-overflow (READ of size 48) while reading exif
|
||||
data). (Stas)
|
||||
|
||||
- Win32:
|
||||
. Fixed bug #76459 (windows linkinfo lacks openbasedir check). (Anatol)
|
||||
|
||||
26 Apr 2018 PHP 5.6.36
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).
|
||||
(Stas)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #76249 (stream filter convert.iconv leads to infinite loop on
|
||||
invalid sequence). (Stas)
|
||||
|
||||
- LDAP:
|
||||
. Fixed bug #76248 (Malicious LDAP-Server Response causes Crash). (Stas)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #76129 (fix for CVE-2018-5712 may not be complete). (Stas)
|
||||
|
||||
29 Mar 2018, PHP 5.6.35
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #75605 (Dumpable FPM child processes allow bypassing opcache
|
||||
access controls). (Jakub Zelenka)
|
||||
|
||||
01 Mar 2018, PHP 5.6.34
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75981 (stack-buffer-overflow while parsing HTTP response). (Stas)
|
||||
|
||||
04 Jan 2018, PHP 5.6.33
|
||||
|
||||
- GD:
|
||||
. Fixed bug #75571 (Potential infinite loop in gdImageCreateFromGifCtx). (cmb)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #74782 (Reflected XSS in .phar 404 page). (Stas)
|
||||
|
||||
26 Sep 2017, PHP 5.6.32
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75055 (Out-Of-Bounds Read in timelib_meridian()). (Derick)
|
||||
|
||||
- mcrypt:
|
||||
. Fixed bug #72535 (arcfour encryption stream filter crashes php). (Leigh)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #75207 (applied upstream patch for CVE-2016-1283). (Anatol)
|
||||
|
||||
06 Jul 2017, PHP 5.6.31
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73807 (Performance problem with processing post request over
|
||||
2000000 chars). (Nikita)
|
||||
. Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from
|
||||
unserialize). (Nikita)
|
||||
. Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
|
||||
(Stas)
|
||||
. Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via
|
||||
php_parse_date()). (Derick)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb)
|
||||
|
||||
- mbstring:
|
||||
. Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227,
|
||||
CVE-2017-9228, CVE-2017-9229) (Remi, Mamoru TASAKA)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
|
||||
(Stas)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #74087 (Segmentation fault in PHP7.1.1(compiled using the bundled PCRE library)).
|
||||
(Stas)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #74145 (wddx parsing empty boolean tag leads to SIGSEGV). (Stas)
|
||||
|
||||
19 Jan 2017, PHP 5.6.30
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #73737 (FPE when parsing a tag format). (Stas)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73549 (Use after free when stream is passed to imagepng). (cmb)
|
||||
. Fixed bug #73868 (DOS vulnerability in gdImageCreateFromGd2Ctx()). (cmb)
|
||||
. Fixed bug #73869 (Signed Integer Overflow gd_io.c). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #68447 (grapheme_extract take an extra trailing character).
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
0=0&~2000000000
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_MAX !== 2147483647)
|
||||
die('skip for 32-bit only');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "0"
|
||||
}
|
||||
@@ -53,7 +53,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
int i_result;
|
||||
int i_op1, i_op2;
|
||||
char str_result[MAX_LENGTH_OF_LONG];
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
free(Z_STRVAL_P(op1));
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=6
|
||||
PHP_RELEASE_VERSION=30
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_RELEASE_VERSION=38
|
||||
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`
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
int fname_len, mime_len, postname_len;
|
||||
zval *cf = return_value;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+7261
-6578
File diff suppressed because it is too large.
Load diff
@@ -899,7 +899,7 @@ datefull = day ([ \t.-])* monthtext ([ \t.-])* year;
|
||||
datenoday = monthtext ([ .\t-])* year4;
|
||||
datenodayrev = year4 ([ .\t-])* monthtext;
|
||||
datetextual = monthtext ([ .\t-])* day [,.stndrh\t ]+ year;
|
||||
datenoyear = monthtext ([ .\t-])* day [,.stndrh\t ]*;
|
||||
datenoyear = monthtext ([ .\t-])* day ([,.stndrh\t ]+|[\000]);
|
||||
datenoyearrev = day ([ .\t-])* monthtext;
|
||||
datenocolon = year4 monthlz daylz;
|
||||
|
||||
@@ -917,8 +917,8 @@ isoweek = year4 "-"? "W" weekofyear;
|
||||
exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz;
|
||||
firstdayof = 'first day of';
|
||||
lastdayof = 'last day of';
|
||||
backof = 'back of ' hour24 space? meridian?;
|
||||
frontof = 'front of ' hour24 space? meridian?;
|
||||
backof = 'back of ' hour24 (space? meridian)?;
|
||||
frontof = 'front of ' hour24 (space? meridian)?;
|
||||
|
||||
/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */
|
||||
clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection;
|
||||
|
||||
@@ -40,7 +40,7 @@ object(DateInterval)#%d (15) {
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(9)
|
||||
int(%d)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ foreach ( $tests as $start => $data )
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Sat, 23 Oct 2010 00:00:00 +0000
|
||||
Fri, 15 Oct 2010 23:00:00 +0000
|
||||
Wed, 15 Dec 2010 16:15:00 +0000
|
||||
Mon, 20 Dec 2010 00:00:00 +0000
|
||||
Mon, 20 Dec 2010 10:00:00 +0000
|
||||
Tue, 21 Dec 2010 12:00:00 +0000
|
||||
Mon, 03 Jan 2011 00:00:00 +0000
|
||||
Mon, 03 Jan 2011 09:00:00 +0000
|
||||
Sat, 23 Oct 2010 00:00:00 +0100
|
||||
Fri, 15 Oct 2010 23:00:00 +0100
|
||||
Sun, 28 Mar 2010 00:15:00 +0000
|
||||
Sun, 28 Mar 2010 02:15:00 +0100
|
||||
Sun, 28 Mar 2010 02:15:00 +0100
|
||||
+10
-4
@@ -1710,7 +1710,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = MIN(length, strlen(value));
|
||||
length = (int) php_strnlen(value, length);
|
||||
}
|
||||
|
||||
/* do not recompute length here */
|
||||
@@ -2545,7 +2545,10 @@ static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, siz
|
||||
return;
|
||||
}
|
||||
/* Check to make sure we are not going to go past the ExifLength */
|
||||
if ((ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) {
|
||||
if (ImageInfo->Thumbnail.size > length
|
||||
|| (ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length
|
||||
|| ImageInfo->Thumbnail.offset > length - ImageInfo->Thumbnail.size
|
||||
) {
|
||||
EXIF_ERRLOG_THUMBEOF(ImageInfo)
|
||||
return;
|
||||
}
|
||||
@@ -2725,6 +2728,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
int NumDirEntries, old_motorola_intel, offset_diff;
|
||||
const maker_note_type *maker_note;
|
||||
char *dir_start;
|
||||
int data_len;
|
||||
|
||||
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
|
||||
if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
|
||||
@@ -2779,6 +2783,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
switch (maker_note->offset_mode) {
|
||||
case MN_OFFSET_MAKER:
|
||||
offset_base = value_ptr;
|
||||
data_len = value_len;
|
||||
break;
|
||||
case MN_OFFSET_GUESS:
|
||||
if (maker_note->offset + 10 + 4 >= value_len) {
|
||||
@@ -2795,6 +2800,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
return FALSE;
|
||||
}
|
||||
offset_base = value_ptr + offset_diff;
|
||||
data_len = value_len - offset_diff;
|
||||
break;
|
||||
default:
|
||||
case MN_OFFSET_NORMAL:
|
||||
@@ -2808,7 +2814,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table TSRMLS_CC)) {
|
||||
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table TSRMLS_CC)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -4210,7 +4216,7 @@ PHP_FUNCTION(exif_imagetype)
|
||||
php_stream * stream;
|
||||
int itype = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &imagefile, &imagefile_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &imagefile, &imagefile_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value)
|
||||
--DESCRIPTION--
|
||||
This test is meant to exhibit memory issues with the `-m` option. Since a lot of
|
||||
notices and warnings are to be expected anyway, we suppress these, since the are
|
||||
not relevant for this test.
|
||||
--INI--
|
||||
error_reporting=E_ALL & ~E_WARNING & ~E_NOTICE
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__ . '/bug76130_1.jpg');
|
||||
exif_read_data(__DIR__ . '/bug76130_2.jpg');
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #76423 (Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__ . '/bug76423.jpg', 0, true, true);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Warning: exif_read_data(%s.jpg): Thumbnail goes IFD boundary or end of file reached in %s on line %d
|
||||
|
||||
Warning: exif_read_data(%s.jpg): File structure corrupted in %s on line %d
|
||||
|
||||
Warning: exif_read_data(%s.jpg): Invalid JPEG file in %s on line %d
|
||||
===DONE===
|
||||
Binary file not shown.
@@ -0,0 +1,79 @@
|
||||
--TEST--
|
||||
Bug 76557 (heap-buffer-overflow (READ of size 48) while reading exif data)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(count(exif_read_data(dirname(__FILE__) . "/bug76557.jpg")));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x010F=Make ): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x8769=Exif_IFD_Po): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x927C=MakerNote ): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > x00EE) in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): File structure corrupted in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Invalid JPEG file in %sbug76557.php on line %d
|
||||
int(1)
|
||||
DONE
|
||||
@@ -142,23 +142,23 @@ Warning: exif_imagetype(0.5): failed to open stream: No such file or directory i
|
||||
bool(false)
|
||||
-- Iteration 10 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 11 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 12 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 13 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 14 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 15 --
|
||||
|
||||
@@ -198,7 +198,7 @@ Warning: exif_imagetype(obj'ct): failed to open stream: No such file or director
|
||||
bool(false)
|
||||
-- Iteration 24 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, resource given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, resource given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 25 --
|
||||
|
||||
|
||||
+10
-2
@@ -136,6 +136,10 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
|
||||
GD2_DBG(php_gd_error("%d Chunks vertically", *ncy));
|
||||
|
||||
if (gd2_compressed(*fmt)) {
|
||||
if (*ncx <= 0 || *ncy <= 0 || *ncx > INT_MAX / *ncy) {
|
||||
GD2_DBG(printf ("Illegal chunk counts: %d * %d\n", *ncx, *ncy));
|
||||
goto fail1;
|
||||
}
|
||||
nc = (*ncx) * (*ncy);
|
||||
GD2_DBG(php_gd_error("Reading %d chunk index entries", nc));
|
||||
if (overflow2(sizeof(t_chunk_info), nc)) {
|
||||
@@ -340,12 +344,16 @@ gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
|
||||
for (x = xlo; x < xhi; x++) {
|
||||
if (im->trueColor) {
|
||||
if (!gdGetInt(&im->tpixels[y][x], in)) {
|
||||
im->tpixels[y][x] = 0;
|
||||
php_gd_error("gd2: EOF while reading\n");
|
||||
gdImageDestroy(im);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
int ch;
|
||||
if (!gdGetByte(&ch, in)) {
|
||||
ch = 0;
|
||||
php_gd_error("gd2: EOF while reading\n");
|
||||
gdImageDestroy(im);
|
||||
return NULL;
|
||||
}
|
||||
im->pixels[y][x] = ch;
|
||||
}
|
||||
|
||||
@@ -147,6 +147,9 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
|
||||
int haveGlobalColormap;
|
||||
gdImagePtr im = 0;
|
||||
|
||||
memset(ColorMap, 0, 3 * MAXCOLORMAPSIZE);
|
||||
memset(localColorMap, 0, 3 * MAXCOLORMAPSIZE);
|
||||
|
||||
/*1.4//imageNumber = 1; */
|
||||
if (! ReadOK(fd,buf,6)) {
|
||||
return 0;
|
||||
@@ -258,10 +261,6 @@ terminated:
|
||||
if (!im) {
|
||||
return 0;
|
||||
}
|
||||
if (!im->colorsTotal) {
|
||||
gdImageDestroy(im);
|
||||
return 0;
|
||||
}
|
||||
/* Check for open colors at the end, so
|
||||
we can reduce colorsTotal and ultimately
|
||||
BitsPerPixel */
|
||||
@@ -272,6 +271,10 @@ terminated:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!im->colorsTotal) {
|
||||
gdImageDestroy(im);
|
||||
return 0;
|
||||
}
|
||||
return im;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -372,7 +375,7 @@ static int
|
||||
GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroDataBlockP)
|
||||
{
|
||||
int i, j, ret;
|
||||
unsigned char count;
|
||||
int count;
|
||||
|
||||
if (flag) {
|
||||
scd->curbit = 0;
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug 73868 (DOS vulnerability in gdImageCreateFromGd2Ctx())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73868.gd2'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromgd2(): gd2: EOF while reading
|
||||
in %s on line %d
|
||||
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #73869 (Signed Integer Overflow gd_io.c)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73869a.gd2'));
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73869b.gd2'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #74435 (Buffer over-read into uninitialized memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatefromgif(__DIR__ . DIRECTORY_SEPARATOR . 'bug74435.gif');
|
||||
var_dump($im);
|
||||
$width = imagesx($im);
|
||||
$height = imagesy($im);
|
||||
for ($i = 0; $i < $width; $i += 16) {
|
||||
for ($j = 0; $j < $height; $j += 16) {
|
||||
if (($index = imagecolorat($im, $i, $j)) >= 2) {
|
||||
list($red, $green, $blue, $alpha) = array_values(imagecolorsforindex($im, $index));
|
||||
if ($red !== 0 || $green !== 0 || $blue !== 0 || $alpha !== 0) {
|
||||
echo "unexpected color at ($i, $j)\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
resource(%d) of type (gd)
|
||||
===DONE===
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #75571 (Infinite loop in GIF reading causing DoS)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imagecreatefromgif(__DIR__ . '/bug75571.gif'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromgif(): '%s' is not a valid GIF file in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -2672,6 +2672,9 @@ static int php_iconv_stream_filter_append_bucket(
|
||||
tcnt = 0;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
|
||||
goto out_failure;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$fh = fopen('php://memory', 'rw');
|
||||
fwrite($fh, "abc");
|
||||
rewind($fh);
|
||||
if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, [])) {
|
||||
stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8//IGNORE', STREAM_FILTER_READ, []);
|
||||
}
|
||||
$a = stream_get_contents($fh);
|
||||
var_dump(strlen($a));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
|
||||
int(3)
|
||||
DONE
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#ifndef COLLATOR_COLLATOR_H
|
||||
#define CCOLLATOR_COLLATOR_H
|
||||
#define COLLATOR_COLLATOR_H
|
||||
|
||||
#include <php.h>
|
||||
|
||||
|
||||
+5
-1
@@ -1103,7 +1103,11 @@ PHP_FUNCTION(ldap_get_entries)
|
||||
|
||||
add_assoc_long(tmp1, "count", num_attrib);
|
||||
dn = ldap_get_dn(ldap, ldap_result_entry);
|
||||
add_assoc_string(tmp1, "dn", dn, 1);
|
||||
if (dn) {
|
||||
add_assoc_string(tmp1, "dn", dn, 1);
|
||||
} else {
|
||||
add_assoc_null(tmp1, "dn");
|
||||
}
|
||||
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS
|
||||
ldap_memfree(dn);
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #76248 (Malicious LDAP-Server Response causes Crash)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (!function_exists('pcntl_fork')) die('skip fork not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$pid = pcntl_fork();
|
||||
const PORT = 12345;
|
||||
if ($pid == 0) {
|
||||
// child
|
||||
$server = stream_socket_server("tcp://127.0.0.1:12345");
|
||||
$socket = stream_socket_accept($server, 3);
|
||||
fwrite($socket, base64_decode("MAwCAQFhBwoBAAQABAAweQIBAmR0BJljbj1yb290LGRjPWV4YW1wbGUsZGM9Y29tMFcwIwQLb2JqZWN0Q2xhc3MxFAQSb3JnYW5pemF0aW9uYWxSb2xlMAwEAmNuMQYEBHJvb3QwIgQLZGVzY3JpcHRpb24xEwQRRGlyZWN0b3J5IE1hbmFnZXIwDAIBAmUHCgEABAAEADB5AgEDZHQEmWNuPXJvb3QsZGM9ZXhhbXBsZSxkYz1jb20wVzAjBAtvYmplY3RDbGFzczEUBBJvcmdhbml6YXRpb25hbFJvbGUwDAQCY24xBgQEcm9vdDAiBAtkZXNjcmlwdGlvbjETBBFEaXJlY3RvcnkgTWFuYWdlcjAMAgEDZQcKAQAEAAQA"));
|
||||
fflush($socket);
|
||||
} else {
|
||||
// parent
|
||||
$ds = ldap_connect("127.0.0.1", PORT);
|
||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
$b = ldap_bind($ds, "cn=root,dc=example,dc=com", "secret");
|
||||
|
||||
$s = ldap_search($ds, "dc=example,dc=com", "(cn=root)");
|
||||
$tt = ldap_get_entries($ds, $s);
|
||||
var_dump($tt);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
["dn"]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -1425,14 +1425,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
|
||||
break;
|
||||
|
||||
case OP_EXACT1: MOP_IN(OP_EXACT1);
|
||||
#if 0
|
||||
DATA_ENSURE(1);
|
||||
if (*p != *s) goto fail;
|
||||
p++; s++;
|
||||
#endif
|
||||
if (*p != *s++) goto fail;
|
||||
DATA_ENSURE(0);
|
||||
p++;
|
||||
MOP_OUT;
|
||||
break;
|
||||
|
||||
@@ -3128,6 +3123,8 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
|
||||
}
|
||||
else {
|
||||
UChar *q = p + reg->dmin;
|
||||
|
||||
if (q >= end) return 0; /* fail */
|
||||
while (p < q) p += enclen(reg->enc, p);
|
||||
}
|
||||
}
|
||||
@@ -3208,7 +3205,13 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
|
||||
else {
|
||||
if (reg->dmax != ONIG_INFINITE_DISTANCE) {
|
||||
*low = p - reg->dmax;
|
||||
if (*low > s) {
|
||||
if (p - str < reg->dmax) {
|
||||
*low = (UChar* )str;
|
||||
if (low_prev)
|
||||
*low_prev = onigenc_get_prev_char_head(reg->enc, str, *low);
|
||||
}
|
||||
else {
|
||||
if (*low > s) {
|
||||
*low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
|
||||
*low, (const UChar** )low_prev);
|
||||
if (low_prev && IS_NULL(*low_prev))
|
||||
@@ -3221,6 +3224,7 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
|
||||
(pprev ? pprev : str), *low);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* no needs to adjust *high, *high is used as range check only */
|
||||
*high = p - reg->dmin;
|
||||
|
||||
@@ -3064,7 +3064,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
|
||||
PUNFETCH;
|
||||
prev = p;
|
||||
num = scan_unsigned_octal_number(&p, end, 3, enc);
|
||||
if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (p == prev) { /* can't read nothing. */
|
||||
num = 0; /* but, it's not error */
|
||||
}
|
||||
@@ -3436,7 +3436,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
|
||||
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
|
||||
prev = p;
|
||||
num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
|
||||
if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (p == prev) { /* can't read nothing. */
|
||||
num = 0; /* but, it's not error */
|
||||
}
|
||||
@@ -4068,7 +4068,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
|
||||
}
|
||||
}
|
||||
|
||||
*state = CCS_VALUE;
|
||||
if (*state != CCS_START)
|
||||
*state = CCS_VALUE;
|
||||
|
||||
*type = CCV_CLASS;
|
||||
return 0;
|
||||
}
|
||||
@@ -4084,7 +4086,11 @@ next_state_val(CClassNode* cc, OnigCodePoint *vs, OnigCodePoint v,
|
||||
switch (*state) {
|
||||
case CCS_VALUE:
|
||||
if (*type == CCV_SB)
|
||||
{
|
||||
if (*vs > 0xff)
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
BITSET_SET_BIT(cc->bs, (int )(*vs));
|
||||
}
|
||||
else if (*type == CCV_CODE_POINT) {
|
||||
r = add_code_range(&(cc->mbuf), env, *vs, *vs);
|
||||
if (r < 0) return r;
|
||||
|
||||
@@ -89,7 +89,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
|
||||
php_stream_bucket_delref(bucket TSRMLS_CC);
|
||||
} else {
|
||||
/* Stream cipher */
|
||||
php_stream_bucket_make_writeable(bucket TSRMLS_CC);
|
||||
bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC);
|
||||
if (data->encrypt) {
|
||||
mcrypt_generic(data->module, bucket->buf, bucket->buflen);
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #72535 arcfour encryption stream filter crashes php
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$passphrase = 'My secret';
|
||||
$plaintext = 'Secret secret secret data';
|
||||
|
||||
$iv = substr(md5('iv' . $passphrase, true), 0, 8);
|
||||
$key = substr(md5('pass1' . $passphrase, true) .
|
||||
md5('pass2' . $passphrase, true), 0, 24);
|
||||
$opts = array('iv' => $iv, 'key' => $key, 'mode' => 'stream');
|
||||
|
||||
$expected = substr($plaintext . $plaintext, 0, 48);
|
||||
|
||||
$fp = fopen('php://memory', 'wb+');
|
||||
stream_filter_append($fp, 'mcrypt.arcfour', STREAM_FILTER_WRITE, $opts);
|
||||
fwrite($fp, $plaintext);
|
||||
?>
|
||||
==NOCRASH==
|
||||
--EXPECT--
|
||||
==NOCRASH==
|
||||
@@ -4982,15 +4982,15 @@ PHP_FUNCTION(openssl_seal)
|
||||
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx));
|
||||
EVP_CIPHER_CTX_cleanup(&ctx);
|
||||
|
||||
if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
|
||||
if (EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) <= 0 ||
|
||||
!EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len) ||
|
||||
!EVP_SealFinal(&ctx, buf + len1, &len2)) {
|
||||
RETVAL_FALSE;
|
||||
efree(buf);
|
||||
EVP_CIPHER_CTX_cleanup(&ctx);
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
EVP_SealFinal(&ctx, buf + len1, &len2);
|
||||
|
||||
if (len1 + len2 > 0) {
|
||||
zval_dtor(sealdata);
|
||||
buf[len1 + len2] = '\0';
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEoDCCBAmgAwIBAgIBJzANBgkqhkiG9w0BAQQFADCBkDELMAkGA1UEFhMCUk8x
|
||||
EDAOBgNVBAgTB1JvbWFuaWExEDAOBgNVBAcTB0NyYWlvdmExDzANBgNVBAoTBlNl
|
||||
cmdpdTETMBEGA1UECxMKU2VyZ2l1IFNSTDESMBAGA1UEAxMJU2VyZ2l1IENBMSMw
|
||||
IQYJKoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTAeFw0wNDA1MTQxMzM0
|
||||
NTZaFw0wNTA1MTQxMzM0NTZaMIGaMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9t
|
||||
YW5pYTEQMA4GA1UEBxMHQ3JhaW92YTETMBEGA1UEChMKU2VyZ2l1IFNSTDETMBEG
|
||||
A1UECxMKU2VyZ2l1IFNSTDEYMBYGA1UEAxMPU2VyZ2l1IHBlcnNvbmFsMSMwIQYJ
|
||||
KoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEF
|
||||
AAOBjQAwgYkCgYEApNj7XXz8T8FcLIWpBniPYom3QcT6T7u0xRPHqtqzj5oboBYp
|
||||
DJe5d354/y0gJTpiLt8+fTrPgWXnbHm3pOHgXzTcX6Arani0GDU0/xDi4VkCRGcS
|
||||
YqX2sJpcDzAbmK9UDMt3xf/O1B8AJan3RfO0Bm3ozTEPziLMkmsiYr5b/L4CAwEA
|
||||
AaOCAfwwggH4MAkGA1UdEwQCMAAwNQYJYIZIAYb4QgENBCgWJkZvciBHcmlkIHVz
|
||||
ZSBvbmx5OyByZXF1ZXN0IHRhZyB1c2VyVGFnMBEGCWCGSAGG+EIBAQQEAwIF4DA/
|
||||
BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vbW9iaWxlLmJsdWUtc29mdHdhcmUucm86
|
||||
OTAvY2EvY3JsLnNodG1sMDUGCWCGSAGG+EIBCAQoFiZodHRwOi8vbW9iaWxlLmJs
|
||||
dWUtc29mdHdhcmUucm86OTAvcHViLzAhBgNVHREEGjAYgRZzZXJnaXVAYmx1ZXNv
|
||||
ZnR3YXJlLnJvMB0GA1UdDgQWBBSwp//5QRXeIzm93TEPl6CyonTg/DCBpwYDVR0j
|
||||
BIGfMIGcoYGWpIGTMIGQMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9tYW5pYTEQ
|
||||
MA4GA1UEBxMHQ3JhaW92YTEPMA0GA1UEChMGU2VyZ2l1MRMwEQYDVQQLEwpTZXJn
|
||||
aXUgU1JMMRIwEAYDVQQDEwlTZXJnaXUgQ0ExIzAhBgkqhkiG9w0BCQEWFG5fc2Vy
|
||||
Z2l1QGhvdG1haWwuY29tggEAMAsGA1UdDwQEAwIE8DAjBglghkgBhvhCAQIEFhYU
|
||||
aHR0cDovLzYyLjIzMS45OC41Mi8wCwYDKgMEBAQ+52I0MA0GCSqGSIb3DQEBBAUA
|
||||
A4GBAIBIOJ+iiLyQfNJEY+IMefayQea0nmuXYY+F+L1DFjSC7xChytgYoPNnKkhh
|
||||
3dWPtxbswiqKYUnGi6y3Hi4UhDsOaDW29t2S305hSc2qgjOiNtRYQIVYQ8EHG1k7
|
||||
Fl63S7uCOhnVJt+4MnUK1N6/pwgsp+Z2GvEsDG1qCKnvNpf6
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #74651: negative-size-param (-1) in memcpy in zif_openssl_seal()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$inputstr = file_get_contents(__DIR__ . "/74651.pem");
|
||||
$pub_key_id = openssl_get_publickey($inputstr);
|
||||
var_dump($pub_key_id);
|
||||
var_dump(openssl_seal($inputstr, $sealed, $ekeys, array($pub_key_id, $pub_key_id), 'AES-128-ECB'));
|
||||
?>
|
||||
--EXPECTF--
|
||||
resource(%d) of type (OpenSSL key)
|
||||
bool(false)
|
||||
@@ -7274,7 +7274,12 @@ for (;; ptr++)
|
||||
so far in order to get the number. If the name is not found, leave
|
||||
the value of recno as 0 for a forward reference. */
|
||||
|
||||
else
|
||||
/* This patch (removing "else") fixes a problem when a reference is
|
||||
to multiple identically named nested groups from within the nest.
|
||||
Once again, it is not the "proper" fix, and it results in an
|
||||
over-allocation of memory. */
|
||||
|
||||
/* else */
|
||||
{
|
||||
ng = cd->named_groups;
|
||||
for (i = 0; i < cd->names_found; i++, ng++)
|
||||
|
||||
@@ -7307,7 +7307,7 @@ if (opcode == OP_COND || opcode == OP_SCOND)
|
||||
|
||||
if (*matchingpath == OP_FAIL)
|
||||
stacksize = 0;
|
||||
if (*matchingpath == OP_RREF)
|
||||
else if (*matchingpath == OP_RREF)
|
||||
{
|
||||
stacksize = GET2(matchingpath, 1);
|
||||
if (common->currententry == NULL)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
CVE-2016-1283, see bug #75207
|
||||
--FILE--
|
||||
<?php
|
||||
preg_match("/(?:F?+(?:^(?(R)a+\"){99}-))(?J)(?'R'(?'R'<((?'RR'(?'R'\){97)?J)?J)(?'R'(?'R'\){99|(:(?|(?'R')(\k'R')|((?'R')))H'R'R)(H'R))))))/", "*b\dc");
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Warning: preg_match(): Compilation failed: unmatched parentheses at offset %d in %s on line %d
|
||||
==DONE==
|
||||
@@ -340,8 +340,7 @@ static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */
|
||||
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
|
||||
sapi_send_headers(TSRMLS_C);
|
||||
PHPWRITE("<html>\n <head>\n <title>Access Denied</title>\n </head>\n <body>\n <h1>403 - File ", sizeof("<html>\n <head>\n <title>Access Denied</title>\n </head>\n <body>\n <h1>403 - File ") - 1);
|
||||
PHPWRITE(entry, entry_len);
|
||||
PHPWRITE(" Access Denied</h1>\n </body>\n</html>", sizeof(" Access Denied</h1>\n </body>\n</html>") - 1);
|
||||
PHPWRITE("Access Denied</h1>\n </body>\n</html>", sizeof("Access Denied</h1>\n </body>\n</html>") - 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -365,8 +364,7 @@ static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, cha
|
||||
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
|
||||
sapi_send_headers(TSRMLS_C);
|
||||
PHPWRITE("<html>\n <head>\n <title>File Not Found</title>\n </head>\n <body>\n <h1>404 - File ", sizeof("<html>\n <head>\n <title>File Not Found</title>\n </head>\n <body>\n <h1>404 - File ") - 1);
|
||||
PHPWRITE(entry, entry_len);
|
||||
PHPWRITE(" Not Found</h1>\n </body>\n</html>", sizeof(" Not Found</h1>\n </body>\n</html>") - 1);
|
||||
PHPWRITE("Not Found</h1>\n </body>\n</html>", sizeof("Not Found</h1>\n </body>\n</html>") - 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ if (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_
|
||||
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
||||
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>";
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>";
|
||||
exit;
|
||||
}
|
||||
$b = pathinfo($a);
|
||||
|
||||
+2
-2
@@ -22,13 +22,13 @@ static inline void phar_get_stub(const char *index_php, const char *web, size_t
|
||||
{
|
||||
static const char newstub0[] = "<?php\n\n$web = '";
|
||||
static const char newstub1_0[] = "';\n\nif (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {\nPhar::interceptFileFuncs();\nset_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());\nPhar::webPhar(null, $web);\ninclude 'phar://' . __FILE__ . '/' . Extract_Phar::START;\nreturn;\n}\n\nif (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) {\nExtract_Phar::go(true);\n$mimes = array(\n'phps' => 2,\n'c' => 'text/plain',\n'cc' => 'text/plain',\n'cpp' => 'text/plain',\n'c++' => 'text/plain',\n'dtd' => 'text/plain',\n'h' => 'text/plain',\n'log' => 'text/plain',\n'rng' => 'text/plain',\n'txt' => 'text/plain',\n'xsd' => 'text/plain',\n'php' => 1,\n'inc' => 1,\n'avi' => 'video/avi',\n'bmp' => 'image/bmp',\n'css' => 'text/css',\n'gif' => 'image/gif',\n'htm' => 'text/html',\n'html' => 'text/html',\n'htmls' => 'text/html',\n'ico' => 'image/x-ico',\n'jpe' => 'image/jpeg',\n'jpg' => 'image/jpeg',\n'jpeg' => 'image/jpeg',\n'js' => 'application/x-javascript',\n'midi' => 'audio/midi',\n'mid' => 'audio/midi',\n'mod' => 'audio/mod',\n'mov' => 'movie/quicktime',\n'mp3' => 'audio/mp3',\n'mpg' => 'video/mpeg',\n'mpeg' => 'video/mpeg',\n'pdf' => 'application/pdf',\n'png' => 'image/png',\n'swf' => 'application/shockwave-flash',\n'tif' => 'image/tiff',\n'tiff' => 'image/tiff',\n'wav' => 'audio/wav',\n'xbm' => 'image/xbm',\n'xml' => 'text/xml',\n);\n\nheader(\"Cache-Control: no-cache, must-revalidate\");\nheader(\"Pragma: no-cache\");\n\n$basename = basename(__FILE__);\nif (!strpos($_SERVER['REQUEST_URI'], $basename)) {\nchdir(Extract_Phar::$temp);\ninclude $web;\nreturn;\n}\n$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));\nif (!$pt || $pt == '/') {\n$pt = $web;\nheader('HTTP/1.1 301 Moved Permanently');\nheader('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);\nexit;\n}\n$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);\nif (!$a || strlen(dirname($a)) < strlen(";
|
||||
static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"<html>\\n <head>\\n <title>File Not Found<title>\\n </head>\\n <body>\\n <h1>404 - File \", $pt, \" Not Found</h1>\\n </body>\\n</html>\";\nexit;\n}\n$b = pathinfo($a);\nif (!isset($b['extension'])) {\nheader('Content-Type: text/plain');\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\nif (isset($mimes[$b['extension']])) {\nif ($mimes[$b['extension']] === 1) {\ninclude $a;\nexit;\n}\nif ($mimes[$b['extension']] === 2) {\nhighlight_file($a);\nexit;\n}\nheader('Content-Type: ' .$mimes[$b['extension']]);\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\n}\n\nclass Extract_Phar\n{\nstatic $temp;\nstatic $origdir;\nconst GZ = 0x1000;\nconst BZ2 = 0x2000;\nconst MASK = 0x3000;\nconst START = '";
|
||||
static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"<html>\\n <head>\\n <title>File Not Found<title>\\n </head>\\n <body>\\n <h1>404 - File Not Found</h1>\\n </body>\\n</html>\";\nexit;\n}\n$b = pathinfo($a);\nif (!isset($b['extension'])) {\nheader('Content-Type: text/plain');\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\nif (isset($mimes[$b['extension']])) {\nif ($mimes[$b['extension']] === 1) {\ninclude $a;\nexit;\n}\nif ($mimes[$b['extension']] === 2) {\nhighlight_file($a);\nexit;\n}\nheader('Content-Type: ' .$mimes[$b['extension']]);\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\n}\n\nclass Extract_Phar\n{\nstatic $temp;\nstatic $origdir;\nconst GZ = 0x1000;\nconst BZ2 = 0x2000;\nconst MASK = 0x3000;\nconst START = '";
|
||||
static const char newstub2[] = "';\nconst LEN = ";
|
||||
static const char newstub3_0[] = ";\n\nstatic function go($return = false)\n{\n$fp = fopen(__FILE__, 'rb');\nfseek($fp, self::LEN);\n$L = unpack('V', $a = (binary)fread($fp, 4));\n$m = (binary)'';\n\ndo {\n$read = 8192;\nif ($L[1] - strlen($m) < 8192) {\n$read = $L[1] - strlen($m);\n}\n$last = (binary)fread($fp, $read);\n$m .= $last;\n} while (strlen($last) && strlen($m) < $L[1]);\n\nif (strlen($m) < $L[1]) {\ndie('ERROR: manifest length read was \"' .\nstrlen($m) .'\" should be \"' .\n$L[1] . '\"');\n}\n\n$info = self::_unpack($m);\n$f = $info['c'];\n\nif ($f & self::GZ) {\nif (!function_exists('gzinflate')) {\ndie('Error: zlib extension is not enabled -' .\n' gzinflate() function needed for zlib-compressed .phars');\n}\n}\n\nif ($f & self::BZ2) {\nif (!function_exists('bzdecompress')) {\ndie('Error: bzip2 extension is not enabled -' .\n' bzdecompress() function needed for bz2-compressed .phars');\n}\n}\n\n$temp = self::tmpdir();\n\nif (!$temp || !is_writable($temp)) {\n$sessionpath = session_save_path();\nif (strpos ($sessionpath, \";\") !== false)\n$sessionpath = substr ($sessionpath, strpos ($sessionpath, \";\")+1);\nif (!file_exists($sessionpath) || !is_dir($sessionpath)) {\ndie('Could not locate temporary directory to extract phar');\n}\n$temp = $sessionpath;\n}\n\n$temp .= '/pharextract/'.basename(__FILE__, '.phar');\nself::$temp = $temp;\nself::$origdir = getcwd();\n@mkdir($temp, 0777, true);\n$temp = realpath($temp);\n\nif (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {\nself::_removeTmpFiles($temp, getcwd());\n@mkdir($temp, 0777, true);\n@file_put_contents($temp . '/' . md5_file(__FILE__), '');\n\nforeach ($info['m'] as $path => $file) {\n$a = !file_exists(dirname($temp . '/' . $path));\n@mkdir(dirname($temp . '/' . $path), 0777, true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] == '/') {\n@mkdir($temp . '/' . $path, 0777);\n} else {\nfile_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));\n@chmod($temp . '/' . $path, 0666);\n}\n}\n}\n\nchdir($temp);\n\nif (!$return) {\ninclude self::ST";
|
||||
static const char newstub3_1[] = "ART;\n}\n}\n\nstatic function tmpdir()\n{\nif (strpos(PHP_OS, 'WIN') !== false) {\nif ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) {\nreturn $var;\n}\nif (is_dir('/temp') || mkdir('/temp')) {\nreturn realpath('/temp');\n}\nreturn false;\n}\nif ($var = getenv('TMPDIR')) {\nreturn $var;\n}\nreturn realpath('/tmp');\n}\n\nstatic function _unpack($m)\n{\n$info = unpack('V', substr($m, 0, 4));\n $l = unpack('V', substr($m, 10, 4));\n$m = substr($m, 14 + $l[1]);\n$s = unpack('V', substr($m, 0, 4));\n$o = 0;\n$start = 4 + $s[1];\n$ret['c'] = 0;\n\nfor ($i = 0; $i < $info[1]; $i++) {\n $len = unpack('V', substr($m, $start, 4));\n$start += 4;\n $savepath = substr($m, $start, $len[1]);\n$start += $len[1];\n $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24)));\n$ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3]\n& 0xffffffff);\n$ret['m'][$savepath][7] = $o;\n$o += $ret['m'][$savepath][2];\n$start += 24 + $ret['m'][$savepath][5];\n$ret['c'] |= $ret['m'][$savepath][4] & self::MASK;\n}\nreturn $ret;\n}\n\nstatic function extractFile($path, $entry, $fp)\n{\n$data = '';\n$c = $entry[2];\n\nwhile ($c) {\nif ($c < 8192) {\n$data .= @fread($fp, $c);\n$c = 0;\n} else {\n$c -= 8192;\n$data .= @fread($fp, 8192);\n}\n}\n\nif ($entry[4] & self::GZ) {\n$data = gzinflate($data);\n} elseif ($entry[4] & self::BZ2) {\n$data = bzdecompress($data);\n}\n\nif (strlen($data) != $entry[0]) {\ndie(\"Invalid internal .phar file (size error \" . strlen($data) . \" != \" .\n$stat[7] . \")\");\n}\n\nif ($entry[3] != sprintf(\"%u\", crc32((binary)$data) & 0xffffffff)) {\ndie(\"Invalid internal .phar file (checksum error)\");\n}\n\nreturn $data;\n}\n\nstatic function _removeTmpFiles($temp, $origdir)\n{\nchdir($temp);\n\nforeach (glob('*') as $f) {\nif (file_exists($f)) {\nis_dir($f) ? @rmdir($f) : @unlink($f);\nif (file_exists($f) && is_dir($f)) {\nself::_removeTmpFiles($f, getcwd());\n}\n}\n}\n\n@rmdir($temp);\nclearstatcache();\nchdir($origdir);\n}\n}\n\nExtract_Phar::go();\n__HALT_COMPIL";
|
||||
static const char newstub3_2[] = "ER(); ?>";
|
||||
|
||||
static const int newstub_len = 6665;
|
||||
static const int newstub_len = 6655;
|
||||
|
||||
*len = spprintf(stub, name_len + web_len + newstub_len, "%s%s%s%s%s%s%d%s%s%s", newstub0, web, newstub1_0, newstub1_1, index_php, newstub2, name_len + web_len + newstub_len, newstub3_0, newstub3_1, newstub3_2);
|
||||
}
|
||||
@@ -18,5 +18,5 @@ echo strlen($p2->getStub()),"\n";
|
||||
echo "ok\n";
|
||||
__HALT_COMPILER(); ?>
|
||||
"
|
||||
6685
|
||||
6675
|
||||
ok
|
||||
@@ -20,6 +20,6 @@ Status: 403 Access Denied
|
||||
<title>Access Denied</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>403 - File /hi Access Denied</h1>
|
||||
<h1>403 - File Access Denied</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -18,6 +18,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /notfound.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -18,6 +18,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /index.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,6 +19,6 @@ Status: 403 Access Denied
|
||||
<title>Access Denied</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>403 - File /hi Access Denied</h1>
|
||||
<h1>403 - File Access Denied</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /notfound.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /index.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -29,7 +29,7 @@ unlink(dirname(__FILE__) . '/brandnewphar.phar');
|
||||
__HALT_COMPILER();
|
||||
?>
|
||||
--EXPECT--
|
||||
int(6683)
|
||||
int(6673)
|
||||
string(200) "<?php
|
||||
function __autoload($class)
|
||||
{
|
||||
|
||||
@@ -123,7 +123,7 @@ NULL
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
int(6683)
|
||||
int(6673)
|
||||
NULL
|
||||
================= convertToZip() =====================
|
||||
bool(false)
|
||||
|
||||
@@ -32,7 +32,7 @@ __HALT_COMPILER();
|
||||
unlink(dirname(__FILE__) . '/brandnewphar.phar');
|
||||
?>
|
||||
--EXPECT--
|
||||
int(6683)
|
||||
int(6673)
|
||||
string(200) "<?php
|
||||
function __autoload($class)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ echo $e->getMessage() . "\n";
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(6683) "<?php
|
||||
string(6673) "<?php
|
||||
|
||||
$web = 'index.php';
|
||||
|
||||
@@ -110,7 +110,7 @@ exit;
|
||||
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
||||
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>";
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>";
|
||||
exit;
|
||||
}
|
||||
$b = pathinfo($a);
|
||||
@@ -144,7 +144,7 @@ const GZ = 0x1000;
|
||||
const BZ2 = 0x2000;
|
||||
const MASK = 0x3000;
|
||||
const START = 'index.php';
|
||||
const LEN = 6685;
|
||||
const LEN = 6675;
|
||||
|
||||
static function go($return = false)
|
||||
{
|
||||
@@ -328,7 +328,7 @@ Extract_Phar::go();
|
||||
__HALT_COMPILER(); ?>"
|
||||
============================================================================
|
||||
============================================================================
|
||||
string(6694) "<?php
|
||||
string(6684) "<?php
|
||||
|
||||
$web = 'index.php';
|
||||
|
||||
@@ -404,7 +404,7 @@ exit;
|
||||
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
||||
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>";
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>";
|
||||
exit;
|
||||
}
|
||||
$b = pathinfo($a);
|
||||
@@ -438,7 +438,7 @@ const GZ = 0x1000;
|
||||
const BZ2 = 0x2000;
|
||||
const MASK = 0x3000;
|
||||
const START = 'my/custom/thingy.php';
|
||||
const LEN = 6696;
|
||||
const LEN = 6686;
|
||||
|
||||
static function go($return = false)
|
||||
{
|
||||
@@ -622,7 +622,7 @@ Extract_Phar::go();
|
||||
__HALT_COMPILER(); ?>"
|
||||
============================================================================
|
||||
============================================================================
|
||||
int(7074)
|
||||
int(7064)
|
||||
============================================================================
|
||||
============================================================================
|
||||
Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
|
||||
@@ -630,7 +630,7 @@ Illegal filename passed in for stub creation, was 401 characters long, and only
|
||||
============================================================================
|
||||
============================================================================
|
||||
============================================================================
|
||||
string(6696) "<?php
|
||||
string(6686) "<?php
|
||||
|
||||
$web = 'the/web.php';
|
||||
|
||||
@@ -706,7 +706,7 @@ exit;
|
||||
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
||||
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>";
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>";
|
||||
exit;
|
||||
}
|
||||
$b = pathinfo($a);
|
||||
@@ -740,7 +740,7 @@ const GZ = 0x1000;
|
||||
const BZ2 = 0x2000;
|
||||
const MASK = 0x3000;
|
||||
const START = 'my/custom/thingy.php';
|
||||
const LEN = 6698;
|
||||
const LEN = 6688;
|
||||
|
||||
static function go($return = false)
|
||||
{
|
||||
@@ -924,6 +924,6 @@ Extract_Phar::go();
|
||||
__HALT_COMPILER(); ?>"
|
||||
============================================================================
|
||||
============================================================================
|
||||
int(7074)
|
||||
int(7064)
|
||||
Illegal web filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
|
||||
===DONE===
|
||||
@@ -70,8 +70,8 @@ var_dump($phar->getAlias());
|
||||
Entry .phar/stub.php does not exist
|
||||
Entry .phar/alias.txt does not exist
|
||||
Cannot set stub ".phar/stub.php" directly in phar "%sphar_offset_check.phar.php", use setStub
|
||||
int(6685)
|
||||
int(6685)
|
||||
int(6675)
|
||||
int(6675)
|
||||
Cannot set alias ".phar/alias.txt" directly in phar "%sphar_offset_check.phar.php", use setAlias
|
||||
string(5) "susan"
|
||||
string(5) "susan"
|
||||
|
||||
@@ -54,7 +54,7 @@ try {
|
||||
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6685) "<?php
|
||||
string(6675) "<?php
|
||||
|
||||
$web = 'index.php';
|
||||
|
||||
@@ -130,7 +130,7 @@ exit;
|
||||
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
||||
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>";
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>";
|
||||
exit;
|
||||
}
|
||||
$b = pathinfo($a);
|
||||
@@ -164,7 +164,7 @@ const GZ = 0x1000;
|
||||
const BZ2 = 0x2000;
|
||||
const MASK = 0x3000;
|
||||
const START = 'index.php';
|
||||
const LEN = 6685;
|
||||
const LEN = 6675;
|
||||
|
||||
static function go($return = false)
|
||||
{
|
||||
@@ -349,7 +349,7 @@ __HALT_COMPILER(); ?>
|
||||
"
|
||||
============================================================================
|
||||
============================================================================
|
||||
string(6696) "<?php
|
||||
string(6686) "<?php
|
||||
|
||||
$web = 'index.php';
|
||||
|
||||
@@ -425,7 +425,7 @@ exit;
|
||||
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
||||
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>";
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>";
|
||||
exit;
|
||||
}
|
||||
$b = pathinfo($a);
|
||||
@@ -459,7 +459,7 @@ const GZ = 0x1000;
|
||||
const BZ2 = 0x2000;
|
||||
const MASK = 0x3000;
|
||||
const START = 'my/custom/thingy.php';
|
||||
const LEN = 6696;
|
||||
const LEN = 6686;
|
||||
|
||||
static function go($return = false)
|
||||
{
|
||||
@@ -644,7 +644,7 @@ __HALT_COMPILER(); ?>
|
||||
"
|
||||
============================================================================
|
||||
============================================================================
|
||||
string(6698) "<?php
|
||||
string(6688) "<?php
|
||||
|
||||
$web = 'the/web.php';
|
||||
|
||||
@@ -720,7 +720,7 @@ exit;
|
||||
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
||||
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>";
|
||||
echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File Not Found</h1>\n </body>\n</html>";
|
||||
exit;
|
||||
}
|
||||
$b = pathinfo($a);
|
||||
@@ -754,7 +754,7 @@ const GZ = 0x1000;
|
||||
const BZ2 = 0x2000;
|
||||
const MASK = 0x3000;
|
||||
const START = 'my/custom/thingy.php';
|
||||
const LEN = 6698;
|
||||
const LEN = 6688;
|
||||
|
||||
static function go($return = false)
|
||||
{
|
||||
@@ -939,6 +939,6 @@ __HALT_COMPILER(); ?>
|
||||
"
|
||||
============================================================================
|
||||
============================================================================
|
||||
int(7076)
|
||||
int(7066)
|
||||
Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
|
||||
===DONE===
|
||||
@@ -19,6 +19,6 @@ Status: 403 Access Denied
|
||||
<title>Access Denied</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>403 - File /hi Access Denied</h1>
|
||||
<h1>403 - File Access Denied</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /notfound.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /index.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -47,12 +47,12 @@ __HALT_COMPILER();
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
int(6683)
|
||||
int(6673)
|
||||
bool(true)
|
||||
string(60) "<?php // tar-based phar archive stub file
|
||||
__HALT_COMPILER();"
|
||||
bool(true)
|
||||
int(6683)
|
||||
int(6673)
|
||||
bool(true)
|
||||
int(6683)
|
||||
int(6673)
|
||||
===DONE===
|
||||
@@ -49,14 +49,14 @@ __HALT_COMPILER();
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
int(6683)
|
||||
int(6673)
|
||||
bool(true)
|
||||
string(60) "<?php // tar-based phar archive stub file
|
||||
__HALT_COMPILER();"
|
||||
bool(true)
|
||||
int(4096)
|
||||
int(6683)
|
||||
int(6673)
|
||||
bool(true)
|
||||
bool(true)
|
||||
int(6683)
|
||||
int(6673)
|
||||
===DONE===
|
||||
@@ -49,14 +49,14 @@ __HALT_COMPILER();
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
int(6683)
|
||||
int(6673)
|
||||
bool(true)
|
||||
string(60) "<?php // tar-based phar archive stub file
|
||||
__HALT_COMPILER();"
|
||||
bool(true)
|
||||
int(8192)
|
||||
int(6683)
|
||||
int(6673)
|
||||
bool(true)
|
||||
bool(true)
|
||||
int(6683)
|
||||
int(6673)
|
||||
===DONE===
|
||||
@@ -54,7 +54,7 @@ __HALT_COMPILER();
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
int(6683)
|
||||
int(6673)
|
||||
string(2) "hi"
|
||||
bool(true)
|
||||
string(60) "<?php // tar-based phar archive stub file
|
||||
@@ -62,10 +62,10 @@ __HALT_COMPILER();"
|
||||
string(2) "hi"
|
||||
bool(true)
|
||||
int(4096)
|
||||
int(6683)
|
||||
int(6673)
|
||||
string(2) "hi"
|
||||
bool(true)
|
||||
bool(true)
|
||||
int(6683)
|
||||
int(6673)
|
||||
string(2) "hi"
|
||||
===DONE===
|
||||
@@ -19,6 +19,6 @@ Status: 403 Access Denied
|
||||
<title>Access Denied</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>403 - File /hi Access Denied</h1>
|
||||
<h1>403 - File Access Denied</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -17,6 +17,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /notfound.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -16,6 +16,6 @@ Status: 404 Not Found
|
||||
<title>File Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 - File /index.php Not Found</h1>
|
||||
<h1>404 - File Not Found</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -46,12 +46,12 @@ __HALT_COMPILER();
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
int(6683)
|
||||
int(6673)
|
||||
bool(true)
|
||||
string(60) "<?php // zip-based phar archive stub file
|
||||
__HALT_COMPILER();"
|
||||
bool(true)
|
||||
int(6683)
|
||||
int(6673)
|
||||
bool(true)
|
||||
int(6683)
|
||||
int(6673)
|
||||
===DONE===
|
||||
@@ -737,9 +737,9 @@ finish:
|
||||
tmp_line, response_code);
|
||||
}
|
||||
}
|
||||
if (tmp_line[tmp_line_len - 1] == '\n') {
|
||||
if (tmp_line_len >= 1 && tmp_line[tmp_line_len - 1] == '\n') {
|
||||
--tmp_line_len;
|
||||
if (tmp_line[tmp_line_len - 1] == '\r') {
|
||||
if (tmp_line_len >= 1 &&tmp_line[tmp_line_len - 1] == '\r') {
|
||||
--tmp_line_len;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,8 @@ PHP_FUNCTION(readlink)
|
||||
PHP_FUNCTION(linkinfo)
|
||||
{
|
||||
char *link;
|
||||
int link_len;
|
||||
char *dirname;
|
||||
int link_len, dir_len;
|
||||
struct stat sb;
|
||||
int ret;
|
||||
|
||||
@@ -95,12 +96,22 @@ PHP_FUNCTION(linkinfo)
|
||||
return;
|
||||
}
|
||||
|
||||
dirname = estrndup(link, link_len);
|
||||
dir_len = php_dirname(dirname, link_len);
|
||||
|
||||
if (php_check_open_basedir(dirname TSRMLS_CC)) {
|
||||
efree(dirname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ret = VCWD_STAT(link, &sb);
|
||||
if (ret == -1) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
|
||||
efree(dirname);
|
||||
RETURN_LONG(-1L);
|
||||
}
|
||||
|
||||
efree(dirname);
|
||||
RETURN_LONG((long) sb.st_dev);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Bug #75981 (stack-buffer-overflow while parsing HTTP response)
|
||||
--INI--
|
||||
allow_url_fopen=1
|
||||
--SKIPIF--
|
||||
<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'server.inc';
|
||||
|
||||
$options = [
|
||||
'http' => [
|
||||
'protocol_version' => '1.1',
|
||||
'header' => 'Connection: Close'
|
||||
],
|
||||
];
|
||||
|
||||
$ctx = stream_context_create($options);
|
||||
|
||||
$responses = [
|
||||
"data://text/plain,000000000100\xA\xA"
|
||||
];
|
||||
$pid = http_server('tcp://127.0.0.1:12342', $responses);
|
||||
|
||||
echo @file_get_contents('http://127.0.0.1:12342/', false, $ctx);
|
||||
|
||||
http_server_kill($pid);
|
||||
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -42,7 +42,7 @@ bool(false)
|
||||
Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 33 of 32 bytes in %sbug25378.php on line %d
|
||||
Notice: unserialize(): Error at offset 32 of 32 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
--TEST--
|
||||
Bug #69425: Use After Free in unserialize()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// POC 1
|
||||
class test
|
||||
{
|
||||
var $ryat;
|
||||
|
||||
function __wakeup()
|
||||
{
|
||||
$this->ryat = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$data = unserialize('a:2:{i:0;O:4:"test":1:{s:4:"ryat";R:1;}i:1;i:2;}');
|
||||
var_dump($data);
|
||||
|
||||
// POC 2
|
||||
$data = unserialize('a:2:{i:0;O:12:"DateInterval":1:{s:1:"y";R:1;}i:1;i:2;}');
|
||||
var_dump($data);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
array(2) {
|
||||
[0]=>
|
||||
object(DateInterval)#1 (15) {
|
||||
["y"]=>
|
||||
int(-1)
|
||||
["m"]=>
|
||||
int(-1)
|
||||
["d"]=>
|
||||
int(-1)
|
||||
["h"]=>
|
||||
int(-1)
|
||||
["i"]=>
|
||||
int(-1)
|
||||
["s"]=>
|
||||
int(-1)
|
||||
["weekday"]=>
|
||||
int(-1)
|
||||
["weekday_behavior"]=>
|
||||
int(-1)
|
||||
["first_last_day_of"]=>
|
||||
int(-1)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(-1)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
--TEST--
|
||||
Bug #70513: GMP Deserialization Type Confusion Vulnerability
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('gmp')) die('skip requires gmp');
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class obj
|
||||
{
|
||||
var $ryat;
|
||||
|
||||
function __wakeup()
|
||||
{
|
||||
$this->ryat = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->aa = 1;
|
||||
$obj->bb = 2;
|
||||
|
||||
$inner = 's:1:"1";a:3:{s:2:"aa";s:2:"hi";s:2:"bb";s:2:"hi";i:0;O:3:"obj":1:{s:4:"ryat";R:2;}}';
|
||||
$exploit = 'a:1:{i:0;C:3:"GMP":'.strlen($inner).':{'.$inner.'}}';
|
||||
$x = unserialize($exploit);
|
||||
var_dump($x);
|
||||
var_dump($obj);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
object(stdClass)#1 (2) {
|
||||
["aa"]=>
|
||||
int(1)
|
||||
["bb"]=>
|
||||
int(2)
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
__wakeup should be able to modify dynamic properties without affecting copies of those properties
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("json")) print "skip json_encode needed"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #72731: Type Confusion in Object Deserialization
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class obj {
|
||||
var $ryat;
|
||||
function __wakeup() {
|
||||
$this->ryat = 0x1122334455;
|
||||
}
|
||||
}
|
||||
|
||||
$poc = 'O:8:"stdClass":1:{i:0;O:3:"obj":1:{s:4:"ryat";R:1;}}';
|
||||
var_dump(unserialize($poc));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%s(73588229205)
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #74111: Heap buffer overread (READ: 1) finish_nested_data from unserialize
|
||||
--FILE--
|
||||
<?php
|
||||
$s = 'O:8:"stdClass":00000000';
|
||||
var_dump(unserialize($s));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 25 of 23 bytes in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Glob wrapper bypasses open_basedir
|
||||
--INI--
|
||||
open_basedir=/does_not_exist
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!in_array("glob", stream_get_wrappers())) echo "skip";
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
foreach ( [ __DIR__, "glob://".__DIR__ ] as $spec) {
|
||||
echo "** Opening $spec\n";
|
||||
$dir = opendir($spec);
|
||||
if (!$dir) {
|
||||
echo "Failed to open $spec\n";
|
||||
continue;
|
||||
}
|
||||
if (false === readdir($dir)) {
|
||||
echo "No files in $spec\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
** Opening %s
|
||||
|
||||
Warning: opendir(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (/does_not_exist) in %s%eglob-wrapper.php on line 5
|
||||
|
||||
Warning: opendir(%s): failed to open dir: Operation not permitted in %s%eglob-wrapper.php on line 5
|
||||
Failed to open %s
|
||||
** Opening glob://%s
|
||||
|
||||
Warning: opendir(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (/does_not_exist) in %s%eglob-wrapper.php on line 5
|
||||
|
||||
Warning: opendir(glob://%s): failed to open dir: operation failed in %s%eglob-wrapper.php on line 5
|
||||
Failed to open glob://%s
|
||||
@@ -48,7 +48,7 @@ DONE
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 0 of 3 bytes in %sbug70436.php on line %d
|
||||
|
||||
Notice: unserialize(): Error at offset 17 of 17 bytes in %sbug70436.php on line %d
|
||||
Notice: unserialize(): Error at offset 16 of 17 bytes in %sbug70436.php on line %d
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
@@ -62,4 +62,4 @@ array(4) {
|
||||
[3]=>
|
||||
bool(false)
|
||||
}
|
||||
DONE
|
||||
DONE
|
||||
+487
-512
File diff suppressed because it is too large.
Load diff
@@ -410,13 +410,12 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long
|
||||
|
||||
static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
|
||||
{
|
||||
if (*((*p)++) == '}')
|
||||
return 1;
|
||||
if (*p >= max || **p != '}') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE
|
||||
zval_ptr_dtor(rval);
|
||||
#endif
|
||||
return 0;
|
||||
(*p)++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #74145 (wddx parsing empty boolean tag leads to SIGSEGV)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("wddx")) print "skip";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$data = file_get_contents(__DIR__ . '/bug74145.xml');
|
||||
$wddx = wddx_deserialize($data);
|
||||
var_dump($wddx);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
NULL
|
||||
DONE
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version='1.0' ?>
|
||||
<!DOCTYPE et SYSTEM 'w'>
|
||||
<wddxPacket ven='1.0'>
|
||||
<array>
|
||||
<var Name="name">
|
||||
<boolean ></boolean>
|
||||
</var>
|
||||
</array>
|
||||
</wddxPacket>
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #75055 Out-Of-Bounds Read in timelib_meridian()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("wddx")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$file_str = dirname(__FILE__) . "/bug75055.wddx";
|
||||
|
||||
$wddx_str = file_get_contents($file_str);
|
||||
print strlen($wddx_str) . " bytes read.\n";
|
||||
|
||||
var_dump(wddx_deserialize($wddx_str));
|
||||
?>
|
||||
--EXPECT--
|
||||
323 bytes read.
|
||||
array(1) {
|
||||
["aDateTime"]=>
|
||||
string(12) "frONt of 0 0"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE wddxPacket SYSTEM 'wddx_0100.dtd'>
|
||||
<wddxPacket version='1.0'>
|
||||
<header/>
|
||||
<data>
|
||||
<struct>
|
||||
<var name='aDateTime'>
|
||||
<dateTime>frONt of 0 0</dateTime>
|
||||
</var>
|
||||
</struct>
|
||||
</data>
|
||||
</wddxPacket>
|
||||
|
||||
+6
-4
@@ -801,20 +801,22 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
|
||||
|
||||
if (atts) for (i = 0; atts[i]; i++) {
|
||||
if (!strcmp(atts[i], EL_VALUE) && atts[i+1] && atts[i+1][0]) {
|
||||
ent.type = ST_BOOLEAN;
|
||||
SET_STACK_VARNAME;
|
||||
|
||||
ALLOC_ZVAL(ent.data);
|
||||
INIT_PZVAL(ent.data);
|
||||
Z_TYPE_P(ent.data) = IS_BOOL;
|
||||
ent.type = ST_BOOLEAN;
|
||||
SET_STACK_VARNAME;
|
||||
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
|
||||
php_wddx_process_data(user_data, atts[i+1], strlen(atts[i+1]));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ALLOC_ZVAL(ent.data);
|
||||
INIT_PZVAL(ent.data);
|
||||
Z_TYPE_P(ent.data) = IS_BOOL;
|
||||
ent.type = ST_BOOLEAN;
|
||||
SET_STACK_VARNAME;
|
||||
ZVAL_FALSE(&ent.data);
|
||||
ZVAL_FALSE(ent.data);
|
||||
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
|
||||
}
|
||||
} else if (!strcmp(name, EL_NULL)) {
|
||||
|
||||
@@ -726,7 +726,12 @@ _zip_read_eocd64(FILE *f, const zip_uint8_t *eocd64loc, const zip_uint8_t *buf,
|
||||
_zip_error_set(error, ZIP_ER_SEEK, EFBIG);
|
||||
return NULL;
|
||||
}
|
||||
if ((flags & ZIP_CHECKCONS) && offset+size != eocd_offset) {
|
||||
if (offset+size > buf_offset + eocd_offset) {
|
||||
/* cdir spans past EOCD record */
|
||||
_zip_error_set(error, ZIP_ER_INCONS, 0);
|
||||
return NULL;
|
||||
}
|
||||
if ((flags & ZIP_CHECKCONS) && offset+size != buf_offset + eocd_offset) {
|
||||
_zip_error_set(error, ZIP_ER_INCONS, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+1
-1
@@ -2662,7 +2662,7 @@ static ZIPARCHIVE_METHOD(extractTo)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &pathto, &pathto_len, &zval_files) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|z", &pathto, &pathto_len, &zval_files) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -237,11 +237,14 @@ typedef struct post_var_data {
|
||||
char *ptr;
|
||||
char *end;
|
||||
uint64_t cnt;
|
||||
|
||||
/* Bytes in ptr that have already been scanned for '&' */
|
||||
size_t already_scanned;
|
||||
} post_var_data_t;
|
||||
|
||||
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC)
|
||||
{
|
||||
char *ksep, *vsep, *val;
|
||||
char *start, *ksep, *vsep, *val;
|
||||
size_t klen, vlen;
|
||||
/* FIXME: string-size_t */
|
||||
unsigned int new_vlen;
|
||||
@@ -250,9 +253,11 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR
|
||||
return 0;
|
||||
}
|
||||
|
||||
vsep = memchr(var->ptr, '&', var->end - var->ptr);
|
||||
start = var->ptr + var->already_scanned;
|
||||
vsep = memchr(start, '&', var->end - start);
|
||||
if (!vsep) {
|
||||
if (!eof) {
|
||||
var->already_scanned = var->end - var->ptr;
|
||||
return 0;
|
||||
} else {
|
||||
vsep = var->end;
|
||||
@@ -285,6 +290,7 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR
|
||||
efree(val);
|
||||
|
||||
var->ptr = vsep + (vsep != var->end);
|
||||
var->already_scanned = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -304,7 +310,7 @@ static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof
|
||||
}
|
||||
}
|
||||
|
||||
if (!eof) {
|
||||
if (!eof && vars->str.c != vars->ptr) {
|
||||
memmove(vars->str.c, vars->ptr, vars->str.len = vars->end - vars->ptr);
|
||||
}
|
||||
return SUCCESS;
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
/* edit configure.in to change version number */
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 6
|
||||
#define PHP_RELEASE_VERSION 30
|
||||
#define PHP_EXTRA_VERSION "RC1"
|
||||
#define PHP_VERSION "5.6.30RC1"
|
||||
#define PHP_VERSION_ID 50630
|
||||
#define PHP_RELEASE_VERSION 38
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "5.6.38"
|
||||
#define PHP_VERSION_ID 50638
|
||||
@@ -213,10 +213,6 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const cha
|
||||
int ret;
|
||||
const char *tmp, *pos;
|
||||
|
||||
if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!strncmp(path, "glob://", sizeof("glob://")-1)) {
|
||||
path += sizeof("glob://")-1;
|
||||
if (opened_path) {
|
||||
@@ -224,6 +220,10 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const cha
|
||||
}
|
||||
}
|
||||
|
||||
if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pglob = ecalloc(sizeof(*pglob), 1);
|
||||
|
||||
if (0 != (ret = glob(path, pglob->flags & GLOB_FLAGMASK, NULL, &pglob->glob))) {
|
||||
|
||||
@@ -678,6 +678,7 @@ zend_first_try {
|
||||
if (!parent_req) {
|
||||
php_apache_request_dtor(r TSRMLS_CC);
|
||||
ctx->request_processed = 1;
|
||||
apr_brigade_cleanup(brigade);
|
||||
bucket = apr_bucket_eos_create(r->connection->bucket_alloc);
|
||||
APR_BRIGADE_INSERT_TAIL(brigade, bucket);
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = {
|
||||
{ "listen.mode", &fpm_conf_set_string, WPO(listen_mode) },
|
||||
{ "listen.allowed_clients", &fpm_conf_set_string, WPO(listen_allowed_clients) },
|
||||
{ "process.priority", &fpm_conf_set_integer, WPO(process_priority) },
|
||||
{ "process.dumpable", &fpm_conf_set_boolean, WPO(process_dumpable) },
|
||||
{ "pm", &fpm_conf_set_pm, WPO(pm) },
|
||||
{ "pm.max_children", &fpm_conf_set_integer, WPO(pm_max_children) },
|
||||
{ "pm.start_servers", &fpm_conf_set_integer, WPO(pm_start_servers) },
|
||||
@@ -613,6 +614,7 @@ static void *fpm_worker_pool_config_alloc() /* {{{ */
|
||||
wp->config->listen_backlog = FPM_BACKLOG_DEFAULT;
|
||||
wp->config->pm_process_idle_timeout = 10; /* 10s by default */
|
||||
wp->config->process_priority = 64; /* 64 means unset */
|
||||
wp->config->process_dumpable = 0;
|
||||
wp->config->clear_env = 1;
|
||||
|
||||
if (!fpm_worker_all_pools) {
|
||||
@@ -1602,6 +1604,7 @@ static void fpm_conf_dump() /* {{{ */
|
||||
} else {
|
||||
zlog(ZLOG_NOTICE, "\tprocess.priority = %d", wp->config->process_priority);
|
||||
}
|
||||
zlog(ZLOG_NOTICE, "\tprocess.dumpable = %s", BOOL2STR(wp->config->process_dumpable));
|
||||
zlog(ZLOG_NOTICE, "\tpm = %s", PM2STR(wp->config->pm));
|
||||
zlog(ZLOG_NOTICE, "\tpm.max_children = %d", wp->config->pm_max_children);
|
||||
zlog(ZLOG_NOTICE, "\tpm.start_servers = %d", wp->config->pm_start_servers);
|
||||
|
||||
@@ -64,6 +64,7 @@ struct fpm_worker_pool_config_s {
|
||||
char *listen_mode;
|
||||
char *listen_allowed_clients;
|
||||
int process_priority;
|
||||
int process_dumpable;
|
||||
int pm;
|
||||
int pm_max_children;
|
||||
int pm_start_servers;
|
||||
|
||||
Loaded 100 of 107 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user