mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 02:00:49 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d61aa2b21 | ||
|
|
90a77d87d4 | ||
|
|
f4b9ad3624 | ||
|
|
bee5749c6c |
No files matched your search
@@ -1,265 +1,5 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
20 Feb 2020, PHP 7.3.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #71876 (Memory corruption htmlspecialchars(): charset `*' not
|
||||
supported). (Nikita)
|
||||
. Fixed bug ##79146 (cscript can fail to run on some systems). (clarodeus)
|
||||
. Fixed bug #78323 (Code 0 is returned on invalid options). (Ivan Mikheykin)
|
||||
. Fixed bug #76047 (Use-after-free when accessing already destructed
|
||||
backtrace arguments). (Nikita)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79078 (Hypothetical use-after-free in curl_multi_add_handle()).
|
||||
(cmb)
|
||||
|
||||
-Intl:
|
||||
. Fixed bug #79212 (NumberFormatter::format() may detect wrong type). (cmb)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #79191 (Error in SoapClient ctor disables DOMDocument::save()).
|
||||
(Nikita, cmb)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #79154 (mb_convert_encoding() can modify $from_encoding). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH).
|
||||
(cmb)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79145 (openssl memory leak). (cmb, Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #79082 (Files added to tar with Phar::buildFromIterator have
|
||||
all-access permissions). (CVE-2020-7063) (stas)
|
||||
. Fixed bug #79171 (heap-buffer-overflow in phar_extract_file).
|
||||
(CVE- 2020-7061) (cmb)
|
||||
. Fixed bug #76584 (PharFileInfo::decompress not working). (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #79115 (ReflectionClass::isCloneable call reflected class
|
||||
__destruct). (Nikita)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79221 (Null Pointer Dereference in PHP Session Upload Progress).
|
||||
(CVE-2020-7062) (stas)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #79151 (heap use after free caused by
|
||||
spl_dllist_it_helper_move_forward). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78902 (Memory leak when using stream_filter_append). (liudaixiao)
|
||||
|
||||
- Testing:
|
||||
. Fixed bug #78090 (bug45161.phpt takes forever to finish). (cmb)
|
||||
|
||||
- XSL:
|
||||
. Fixed bug #70078 (XSL callbacks with nodes as parameter leak memory). (cmb)
|
||||
|
||||
23 Jan 2020, PHP 7.3.14
|
||||
|
||||
- Core
|
||||
. Fixed bug #78999 (Cycle leak when using function result as temporary).
|
||||
(Dmitry)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79033 (Curl timeout error with specific url and post). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #79015 (undefined-behavior in php_date.c). (cmb)
|
||||
|
||||
- DBA:
|
||||
. Fixed bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached).
|
||||
(cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #74170 (locale information change after mime_content_type).
|
||||
(Sergei Turchanov)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #78923 (Artifacts when convoluting image with transparency).
|
||||
(wilson chen)
|
||||
. Fixed bug #79067 (gdTransformAffineCopy() may use unitialized values). (cmb)
|
||||
. Fixed bug #79068 (gdTransformAffineCopy() changes interpolation method).
|
||||
(cmb)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #79037 (global buffer-overflow in `mbfl_filt_conv_big5_wchar`).
|
||||
(CVE-2020-7060) (Nikita)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #79040 (Warning Opcode handlers are unusable due to ASLR). (cmb)
|
||||
|
||||
- Pcntl:
|
||||
. Fixed bug #78402 (Converting null to string in error message is bad DX).
|
||||
(SATŌ Kentarō)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #78983 (pdo_pgsql config.w32 cannot find libpq-fe.h). (SATŌ
|
||||
Kentarō)
|
||||
. Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ
|
||||
Kentarō)
|
||||
. Fixed bug #78982 (pdo_pgsql returns dead persistent connection). (SATŌ
|
||||
Kentarō)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79091 (heap use-after-free in session_create_id()). (cmb, Nikita)
|
||||
|
||||
- Shmop:
|
||||
. Fixed bug #78538 (shmop memory leak). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79099 (OOB read in php_strip_tags_ex). (CVE-2020-7059). (cmb)
|
||||
. Fixed bug #54298 (Using empty additional_headers adding extraneous CRLF).
|
||||
(cmb)
|
||||
|
||||
18 Dec 2019, PHP 7.3.13
|
||||
|
||||
- Bcmath:
|
||||
. Fixed bug #78878 (Buffer underflow in bc_shift_addsub). (CVE-2019-11046).
|
||||
(cmb)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78862 (link() silently truncates after a null byte on Windows).
|
||||
(CVE-2019-11044). (cmb)
|
||||
. Fixed bug #78863 (DirectoryIterator class silently truncates after a null
|
||||
byte). (CVE-2019-11045). (cmb)
|
||||
. Fixed bug #78943 (mail() may release string with refcount==1 twice).
|
||||
(CVE-2019-11049). (cmb)
|
||||
. Fixed bug #78787 (Segfault with trait overriding inherited private shadow
|
||||
property). (Nikita)
|
||||
. Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value).
|
||||
(Antony Dovgal, Dmitry)
|
||||
. Fixed bug #78296 (is_file fails to detect file). (cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #78793 (Use-after-free in exif parsing under memory sanitizer).
|
||||
(CVE-2019-11050). (Nikita)
|
||||
. Fixed bug #78910 (Heap-buffer-overflow READ in exif). (CVE-2019-11047).
|
||||
(Nikita)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #78849 (GD build broken with -D SIGNED_COMPARE_SLOW). (cmb)
|
||||
|
||||
- MBString:
|
||||
. Upgraded bundled Oniguruma to 6.9.4. (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed potential ASLR related invalid opline handler issues. (cmb)
|
||||
. Fixed $x = (bool)$x; with opcache (should emit undeclared variable notice).
|
||||
(Tyson Andre)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #78853 (preg_match() may return integer > 1). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78759 (array_search in $GLOBALS). (Nikita)
|
||||
. Fixed bug #77638 (var_export'ing certain class instances segfaults). (cmb)
|
||||
. Fixed bug #78840 (imploding $GLOBALS crashes). (cmb)
|
||||
. Fixed bug #78833 (Integer overflow in pack causes out-of-bound access).
|
||||
(cmb)
|
||||
. Fixed bug #78814 (strip_tags allows / in tag name => whitelist bypass).
|
||||
(cmb)
|
||||
|
||||
21 Nov 2019, PHP 7.3.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78658 (Memory corruption using Closure::bindTo). (Nikita)
|
||||
. Fixed bug #78656 (Parse errors classified as highest log-level). (Erik
|
||||
Lundin)
|
||||
. Fixed bug #78752 (Segfault if GC triggered while generator stack frame is
|
||||
being destroyed). (Nikita)
|
||||
. Fixed bug #78689 (Closure::fromCallable() doesn't handle
|
||||
[Closure, '__invoke']). (Nikita)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #78694 (Appending to a variant array causes segfault). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #70153 (\DateInterval incorrectly unserialized). (Maksim Iakunin)
|
||||
. Fixed bug #78751 (Serialising DatePeriod converts DateTimeImmutable). (cmb)
|
||||
|
||||
- Iconv:
|
||||
. Fixed bug #78642 (Wrong libiconv version displayed). (gedas at martynas,
|
||||
cmb).
|
||||
|
||||
- OpCache:
|
||||
. Fixed bug #78654 (Incorrectly computed opcache checksum on files with
|
||||
non-ascii characters). (mhagstrand)
|
||||
. Fixed bug #78747 (OpCache corrupts custom extension result). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #78775 (TLS issues from HTTP request affecting other encrypted
|
||||
connections). (Nikita)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #78697 (ReflectionClass::ImplementsInterface - inaccurate error
|
||||
message with traits). (villfa)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #78665 (Multicasting may leak memory). (cmb)
|
||||
|
||||
24 Oct 2019, PHP 7.3.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78535 (auto_detect_line_endings value not parsed as bool).
|
||||
(bugreportuser)
|
||||
. Fixed bug #78620 (Out of memory error). (cmb, Nikita)
|
||||
|
||||
- Exif :
|
||||
. Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
|
||||
(Kalle)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #78599 (env_path_info underflow in fpm_main.c can lead to RCE).
|
||||
(CVE-2019-11043) (Jakub Zelenka)
|
||||
. Fixed bug #78413 (request_terminate_timeout does not take effect after
|
||||
fastcgi_finish_request). (Sergei Turchanov)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #78633 (Heap buffer overflow (read) in mb_eregi). (cmb)
|
||||
. Fixed bug #78579 (mb_decode_numericentity: args number inconsistency).
|
||||
(cmb)
|
||||
. Fixed bug #78609 (mb_check_encoding() no longer supports stringable
|
||||
objects). (cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #76809 (SSL settings aren't respected when persistent connections
|
||||
are used). (fabiomsouto)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #78525 (Memory leak in pdo when reusing native prepared
|
||||
statements). (Nikita)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #78272 (calling preg_match() before pcntl_fork() will freeze
|
||||
child process). (Nikita)
|
||||
|
||||
- PDO_MySQL:
|
||||
. Fixed bug #78623 (Regression caused by "SP call yields additional empty
|
||||
result set"). (cmb)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #78624 (session_gc return value for user defined session
|
||||
handlers). (bshaffer)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76342 (file_get_contents waits twice specified timeout).
|
||||
(Thomas Calvet)
|
||||
. Fixed bug #78612 (strtr leaks memory when integer keys are used and the
|
||||
subject string shorter). (Nikita)
|
||||
. Fixed bug #76859 (stream_get_line skips data if used with data-generating
|
||||
filter). (kkopachev)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #78641 (addGlob can modify given remove_path value). (cmb)
|
||||
|
||||
26 Sep 2019, PHP 7.3.10
|
||||
|
||||
- Core:
|
||||
@@ -466,10 +206,6 @@ PHP NEWS
|
||||
. Implemented FR #72189 (Add missing CURL_VERSION_* constants). (Javier
|
||||
Spagnoletti)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #77909 (DatePeriod::__construct() with invalid recurrence count
|
||||
value). (Ignace Nyamagana Butera)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16).
|
||||
(CVE-2019-11040) (Stas)
|
||||
|
||||
+1
-7
@@ -721,7 +721,6 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
TSRM_API int shmdt(const void *shmaddr)
|
||||
{/*{{{*/
|
||||
shm_pair *shm = shm_get(0, (void*)shmaddr);
|
||||
int ret;
|
||||
|
||||
if (!shm->segment) {
|
||||
return -1;
|
||||
@@ -731,12 +730,7 @@ TSRM_API int shmdt(const void *shmaddr)
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch--;
|
||||
|
||||
ret = UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
if (!ret && shm->descriptor->shm_nattch <= 0) {
|
||||
ret = UnmapViewOfFile(shm->descriptor) ? 0 : -1;
|
||||
shm->descriptor = NULL;
|
||||
}
|
||||
return ret;
|
||||
return UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
}/*}}}*/
|
||||
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
|
||||
|
||||
@@ -273,10 +273,6 @@ FPM:
|
||||
disabling output decoration for workers output when catch_workers_output
|
||||
enabled.
|
||||
. The getallheaders() function is now also available.
|
||||
. In PHP 7.3.11 a new pool option
|
||||
request_terminate_timeout_track_finished has been added. When enabled,
|
||||
request_terminate_timeout will also apply after fastcgi_finish_request()
|
||||
has been called, as well as during execution of shutdown functions.
|
||||
|
||||
========================================
|
||||
4. Deprecated Functionality
|
||||
@@ -490,12 +486,6 @@ JSON:
|
||||
Curl:
|
||||
. libcurl >= 7.15.5 is now required.
|
||||
|
||||
DBA:
|
||||
. As of PHP 7.3.14, dba_open() accepts a fifth optional parameter for lmdb
|
||||
databases which allows to specify the mapsize. The parameter defaults to
|
||||
zero, in which case the compiled in default mapsize (usually 1048576) will
|
||||
be used. The mapsize should be a multiple of the page size of the OS.
|
||||
|
||||
Filter:
|
||||
. FILTER_VALIDATE_FLOAT now also supports a `thousand` option, which
|
||||
defines the set of allowed thousand separator chars. The default (`"',."`)
|
||||
|
||||
@@ -94,7 +94,7 @@ L0:
|
||||
}
|
||||
}));
|
||||
|
||||
assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
|
||||
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
|
||||
class A {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof foo;
|
||||
@@ -140,7 +140,6 @@ assert(0 && ($a = function () {
|
||||
if ($a) {
|
||||
} elseif ($b) {
|
||||
}
|
||||
if ($a); else;
|
||||
}));
|
||||
|
||||
?>
|
||||
@@ -244,7 +243,7 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c,
|
||||
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
|
||||
Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
|
||||
class A {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof foo;
|
||||
@@ -293,7 +292,4 @@ Warning: assert(): assert(0 && ($a = function () {
|
||||
if ($a) {
|
||||
} elseif ($b) {
|
||||
}
|
||||
if ($a) {
|
||||
} else {
|
||||
}
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
@@ -25,8 +25,9 @@ try {
|
||||
--EXPECTF--
|
||||
1. Exception: aaa in %sbug52361.php:5
|
||||
Stack trace:
|
||||
#0 %sbug52361.php(16): aaa->__destruct()
|
||||
#1 {main}
|
||||
#0 %sbug52361.php(13): aaa->__destruct()
|
||||
#1 %sbug52361.php(16): bbb()
|
||||
#2 {main}
|
||||
2. Exception: bbb in %sbug52361.php:13
|
||||
Stack trace:
|
||||
#0 %sbug52361.php(16): bbb()
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
--TEST--
|
||||
Bug #76047: Use-after-free when accessing already destructed backtrace arguments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Vuln {
|
||||
public $a;
|
||||
public function __destruct() {
|
||||
unset($this->a);
|
||||
$backtrace = (new Exception)->getTrace();
|
||||
var_dump($backtrace);
|
||||
}
|
||||
}
|
||||
|
||||
function test($arg) {
|
||||
$arg = str_shuffle(str_repeat('A', 79));
|
||||
$vuln = new Vuln();
|
||||
$vuln->a = $arg;
|
||||
}
|
||||
|
||||
function test2($arg) {
|
||||
$$arg = 1; // Trigger symbol table
|
||||
$arg = str_shuffle(str_repeat('A', 79));
|
||||
$vuln = new Vuln();
|
||||
$vuln->a = $arg;
|
||||
}
|
||||
|
||||
test('x');
|
||||
test2('x');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(10) "__destruct"
|
||||
["class"]=>
|
||||
string(4) "Vuln"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(10) "__destruct"
|
||||
["class"]=>
|
||||
string(4) "Vuln"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78658: Memory corruption using Closure::bindTo()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$c = function(){};
|
||||
|
||||
$scope = "AAAA";
|
||||
$scope = "{$scope}BBBB";
|
||||
$c->bindTo(new stdClass, $scope);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Class 'AAAABBBB' not found in %s on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78689: Closure::fromCallable() doesn't handle [Closure, '__invoke']
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [function () { echo "123\n"; }, '__invoke'];
|
||||
$a();
|
||||
|
||||
$b = Closure::fromCallable($a);
|
||||
$b();
|
||||
?>
|
||||
--EXPECT--
|
||||
123
|
||||
123
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78752: Segfault if GC triggered while generator stack frame is being destroyed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen(&$gen) {
|
||||
$a = new stdClass;
|
||||
$a->a = $a;
|
||||
$b = new stdClass;
|
||||
$b->b = $b;
|
||||
yield 1;
|
||||
}
|
||||
|
||||
$gen = gen($gen);
|
||||
var_dump($gen->current());
|
||||
for ($i = 0; $i < 9999; $i++) {
|
||||
$a = new stdClass;
|
||||
$a->a = $a;
|
||||
}
|
||||
$gen->next();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78787: Segfault with trait overriding inherited private shadow property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
private $prop;
|
||||
}
|
||||
class C1 {
|
||||
/** Doc comment */
|
||||
private $prop;
|
||||
}
|
||||
class C2 extends C1 {
|
||||
}
|
||||
class C3 extends C2 {
|
||||
use T;
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78868: Calling __autoload() with incorrect EG(fake_scope) value
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private $private = 1;
|
||||
|
||||
function foo() {
|
||||
$this->private++; //fails with EG(fake_scope) != NULL && EG(fake_scope) != "C"
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
static $foo = B::foo; //not resolved on include()
|
||||
}
|
||||
|
||||
function main_autoload($class_name) {
|
||||
$c = new C;
|
||||
$c->foo();
|
||||
//doesn't affect the error
|
||||
eval("class B {const foo = 1;}");
|
||||
}
|
||||
|
||||
spl_autoload_register('main_autoload', false);
|
||||
|
||||
$classA = new ReflectionClass("A");
|
||||
$props = $classA->getProperties();
|
||||
$props[0]->setValue(2); //causes constant resolving, which runs autoload, all with EG(fake_scope) == "A"
|
||||
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78921: When Reflection triggers class load, property visibility is incorrect
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($className) {
|
||||
if ($className == 'PrivateStatic') {
|
||||
class PrivateStatic
|
||||
{
|
||||
const SOME_CONST = 13;
|
||||
private static $privateStaticVarArray = ['a', 'b', 'c'];
|
||||
private static $otherStatic;
|
||||
public static function init()
|
||||
{
|
||||
self::$otherStatic = self::$privateStaticVarArray;
|
||||
}
|
||||
}
|
||||
PrivateStatic::init();
|
||||
}
|
||||
});
|
||||
|
||||
class OtherClass
|
||||
{
|
||||
const MY_CONST = PrivateStatic::SOME_CONST;
|
||||
public static $prop = 'my property';
|
||||
}
|
||||
|
||||
$reflectionClass = new ReflectionClass('OtherClass');
|
||||
$reflectionProperty = $reflectionClass->getProperty('prop');
|
||||
$reflectionProperty->setAccessible(true);
|
||||
$value = $reflectionProperty->getValue();
|
||||
echo "Value is $value\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Value is my property
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78999 (Cycle leak when using function result as temporary)
|
||||
--FILE--
|
||||
<?php
|
||||
function get() {
|
||||
$t = new stdClass;
|
||||
$t->prop = $t;
|
||||
return $t;
|
||||
}
|
||||
var_dump(get());
|
||||
var_dump(gc_collect_cycles());
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["prop"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
int(1)
|
||||
@@ -1,9 +0,0 @@
|
||||
--TEST--
|
||||
Incorrect constant evaluation of and/or (OSS-Fuzz #19255)
|
||||
--FILE--
|
||||
<?php
|
||||
const C = 0 && __namespace__;
|
||||
var_dump(C);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Freeing of function "name" when dynamic call fails
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
$bar = "bar";
|
||||
("foo" . $bar)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
$bar = ["bar"];
|
||||
(["foo"] + $bar)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
(new stdClass)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Call to undefined function foobar()
|
||||
Function name must be a string
|
||||
Function name must be a string
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Generator exceptions during shutdown should not be swallowed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
echo "before yield\n";
|
||||
yield;
|
||||
echo "after yield\n";
|
||||
} finally {
|
||||
echo "before yield in finally\n";
|
||||
yield;
|
||||
echo "after yield in finally\n";
|
||||
}
|
||||
echo "after finally\n";
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->rewind();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
before yield
|
||||
before yield in finally
|
||||
|
||||
Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,8 +0,0 @@
|
||||
--TEST--
|
||||
Using __COMPILER_HALF_OFFSET__ with trailing {} (OSS-Fuzz #17895)
|
||||
--FILE--
|
||||
<?php
|
||||
__COMPILER_HALT_OFFSET__;
|
||||
{}
|
||||
--EXPECTF--
|
||||
Warning: Use of undefined constant __COMPILER_HALT_OFFSET__ - assumed '__COMPILER_HALT_OFFSET__' (this will throw an Error in a future version of PHP) in %s on line %d
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Memory leak on ** with result==op1 array
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = [0];
|
||||
$x **= 1;
|
||||
var_dump($x);
|
||||
|
||||
$x = [0];
|
||||
$x **= $x;
|
||||
var_dump($x);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(0)
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Calling a static method on a non-existing class
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = "foo";
|
||||
try {
|
||||
Test::{$str . "bar"}();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Class 'Test' not found
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
No warnings should be thrown during heredoc scan-ahead
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
<<<TEST
|
||||
${x}
|
||||
\400
|
||||
${/*}
|
||||
TEST;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Unexpected character in input: '' (ASCII=1) state=0 in %s on line %d
|
||||
|
||||
Warning: Octal escape sequence overflow \400 is greater than \377 in %s on line %d
|
||||
|
||||
Warning: Unterminated comment starting line %d in %s on line %d
|
||||
|
||||
Parse error: syntax error, unexpected end of file in %s on line %d
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "3.3.15"
|
||||
#define ZEND_VERSION "3.3.10"
|
||||
|
||||
#define ZEND_ENGINE_3
|
||||
|
||||
|
||||
@@ -4082,12 +4082,6 @@ ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string
|
||||
zval *property;
|
||||
zend_class_entry *old_scope = EG(fake_scope);
|
||||
|
||||
if (UNEXPECTED(!(scope->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) {
|
||||
if (UNEXPECTED(zend_update_class_constants(scope)) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
EG(fake_scope) = scope;
|
||||
property = zend_std_get_static_property(scope, name, 0);
|
||||
EG(fake_scope) = old_scope;
|
||||
|
||||
+2
-7
@@ -1792,17 +1792,12 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
size_t alignment = MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE);
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
#else
|
||||
size_t alignment = REAL_PAGE_SIZE;
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
|
||||
#endif
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, alignment);
|
||||
void *ptr;
|
||||
|
||||
if (UNEXPECTED(new_size < size)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu + %zu)", size, alignment);
|
||||
}
|
||||
|
||||
#if ZEND_MM_LIMIT
|
||||
if (UNEXPECTED(new_size > heap->limit - heap->real_size)) {
|
||||
if (zend_mm_gc(heap) && new_size <= heap->limit - heap->real_size) {
|
||||
|
||||
+2
-2
@@ -1158,7 +1158,7 @@ tail_call:
|
||||
} else {
|
||||
zend_ast_export_indent(str, indent);
|
||||
smart_str_appends(str, "} else ");
|
||||
if (ast->child[1] && ast->child[1]->kind == ZEND_AST_IF) {
|
||||
if (ast->child[1]->kind == ZEND_AST_IF) {
|
||||
list = (zend_ast_list*)ast->child[1];
|
||||
goto tail_call;
|
||||
} else {
|
||||
@@ -1463,7 +1463,7 @@ simple_list:
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_TYPE:
|
||||
switch (ast->attr & ~ZEND_TYPE_NULLABLE) {
|
||||
switch (ast->attr) {
|
||||
case IS_ARRAY: APPEND_STR("array");
|
||||
case IS_CALLABLE: APPEND_STR("callable");
|
||||
EMPTY_SWITCH_DEFAULT_CASE();
|
||||
|
||||
+2
-10
@@ -200,7 +200,7 @@ ZEND_METHOD(Closure, bind)
|
||||
ce = closure->func.common.scope;
|
||||
} else if ((ce = zend_lookup_class_ex(class_name, NULL, 1)) == NULL) {
|
||||
zend_error(E_WARNING, "Class '%s' not found", ZSTR_VAL(class_name));
|
||||
zend_tmp_string_release(tmp_class_name);
|
||||
zend_string_release_ex(class_name, 0);
|
||||
RETURN_NULL();
|
||||
}
|
||||
zend_tmp_string_release(tmp_class_name);
|
||||
@@ -268,16 +268,8 @@ static int zend_create_closure_from_callable(zval *return_value, zval *callable,
|
||||
|
||||
mptr = fcc.function_handler;
|
||||
if (mptr->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
/* For Closure::fromCallable([$closure, "__invoke"]) return $closure. */
|
||||
if (fcc.object && fcc.object->ce == zend_ce_closure
|
||||
&& zend_string_equals_literal(mptr->common.function_name, "__invoke")) {
|
||||
ZVAL_OBJ(return_value, fcc.object);
|
||||
GC_ADDREF(fcc.object);
|
||||
zend_free_trampoline(mptr);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
memset(&call, 0, sizeof(zend_internal_function));
|
||||
|
||||
call.type = ZEND_INTERNAL_FUNCTION;
|
||||
call.fn_flags = mptr->common.fn_flags & ZEND_ACC_STATIC;
|
||||
call.handler = zend_closure_call_magic;
|
||||
|
||||
+15
-25
@@ -1693,17 +1693,13 @@ ZEND_API void zend_activate_auto_globals(void) /* {{{ */
|
||||
int ZEND_FASTCALL zendlex(zend_parser_stack_elem *elem) /* {{{ */
|
||||
{
|
||||
zval zv;
|
||||
int ret;
|
||||
|
||||
if (CG(increment_lineno)) {
|
||||
CG(zend_lineno)++;
|
||||
CG(increment_lineno) = 0;
|
||||
}
|
||||
|
||||
ret = lex_scan(&zv, elem);
|
||||
ZEND_ASSERT(!EG(exception) || ret == T_ERROR);
|
||||
return ret;
|
||||
|
||||
return lex_scan(&zv, elem);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -7768,9 +7764,6 @@ void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
|
||||
|
||||
while (last && last->kind == ZEND_AST_STMT_LIST) {
|
||||
zend_ast_list *list = zend_ast_get_list(last);
|
||||
if (list->children == 0) {
|
||||
break;
|
||||
}
|
||||
last = list->child[list->children-1];
|
||||
}
|
||||
if (last && last->kind == ZEND_AST_HALT_COMPILER) {
|
||||
@@ -8549,28 +8542,25 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
case ZEND_AST_AND:
|
||||
case ZEND_AST_OR:
|
||||
{
|
||||
zend_bool child0_is_true, child1_is_true;
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
|
||||
int i;
|
||||
for (i = 0; i <= 1; i++) {
|
||||
zend_eval_const_expr(&ast->child[i]);
|
||||
if (ast->child[i]->kind == ZEND_AST_ZVAL) {
|
||||
if (zend_is_true(zend_ast_get_zval(ast->child[i])) == (ast->kind == ZEND_AST_OR)) {
|
||||
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
child0_is_true = zend_is_true(zend_ast_get_zval(ast->child[0]));
|
||||
if (child0_is_true == (ast->kind == ZEND_AST_OR)) {
|
||||
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
child1_is_true = zend_is_true(zend_ast_get_zval(ast->child[1]));
|
||||
if (ast->kind == ZEND_AST_OR) {
|
||||
ZVAL_BOOL(&result, child0_is_true || child1_is_true);
|
||||
ZVAL_BOOL(&result, zend_is_true(zend_ast_get_zval(ast->child[0])) || zend_is_true(zend_ast_get_zval(ast->child[1])));
|
||||
} else {
|
||||
ZVAL_BOOL(&result, child0_is_true && child1_is_true);
|
||||
ZVAL_BOOL(&result, zend_is_true(zend_ast_get_zval(ast->child[0])) && zend_is_true(zend_ast_get_zval(ast->child[1])));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -836,7 +836,6 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
zend_string *lc_name;
|
||||
zend_fcall_info fcall_info;
|
||||
zend_fcall_info_cache fcall_cache;
|
||||
zend_class_entry *orig_fake_scope;
|
||||
|
||||
if (key) {
|
||||
lc_name = Z_STR_P(key);
|
||||
@@ -923,14 +922,11 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
fcall_cache.called_scope = NULL;
|
||||
fcall_cache.object = NULL;
|
||||
|
||||
orig_fake_scope = EG(fake_scope);
|
||||
EG(fake_scope) = NULL;
|
||||
zend_exception_save();
|
||||
if ((zend_call_function(&fcall_info, &fcall_cache) == SUCCESS) && !EG(exception)) {
|
||||
ce = zend_hash_find_ptr(EG(class_table), lc_name);
|
||||
}
|
||||
zend_exception_restore();
|
||||
EG(fake_scope) = orig_fake_scope;
|
||||
|
||||
zval_ptr_dtor(&args[0]);
|
||||
zval_ptr_dtor_str(&fcall_info.function_name);
|
||||
|
||||
+11
-16
@@ -96,18 +96,16 @@ ZEND_API zend_execute_data* zend_generator_freeze_call_stack(zend_execute_data *
|
||||
/* }}} */
|
||||
|
||||
static void zend_generator_cleanup_unfinished_execution(
|
||||
zend_generator *generator, zend_execute_data *execute_data, uint32_t catch_op_num) /* {{{ */
|
||||
zend_generator *generator, uint32_t catch_op_num) /* {{{ */
|
||||
{
|
||||
zend_execute_data *execute_data = generator->execute_data;
|
||||
|
||||
if (execute_data->opline != execute_data->func->op_array.opcodes) {
|
||||
/* -1 required because we want the last run opcode, not the next to-be-run one. */
|
||||
uint32_t op_num = execute_data->opline - execute_data->func->op_array.opcodes - 1;
|
||||
|
||||
if (UNEXPECTED(generator->frozen_call_stack)) {
|
||||
/* Temporarily restore generator->execute_data if it has been NULLed out already. */
|
||||
zend_execute_data *save_ex = generator->execute_data;
|
||||
generator->execute_data = execute_data;
|
||||
zend_generator_restore_call_stack(generator);
|
||||
generator->execute_data = save_ex;
|
||||
}
|
||||
zend_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
}
|
||||
@@ -118,9 +116,6 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
{
|
||||
if (EXPECTED(generator->execute_data)) {
|
||||
zend_execute_data *execute_data = generator->execute_data;
|
||||
/* Null out execute_data early, to prevent double frees if GC runs while we're
|
||||
* already cleaning up execute_data. */
|
||||
generator->execute_data = NULL;
|
||||
|
||||
if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) {
|
||||
zend_clean_and_cache_symbol_table(execute_data->symbol_table);
|
||||
@@ -139,12 +134,12 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
return;
|
||||
}
|
||||
|
||||
zend_vm_stack_free_extra_args(execute_data);
|
||||
zend_vm_stack_free_extra_args(generator->execute_data);
|
||||
|
||||
/* Some cleanups are only necessary if the generator was closed
|
||||
* before it could finish execution (reach a return statement). */
|
||||
if (UNEXPECTED(!finished_execution)) {
|
||||
zend_generator_cleanup_unfinished_execution(generator, execute_data, 0);
|
||||
zend_generator_cleanup_unfinished_execution(generator, 0);
|
||||
}
|
||||
|
||||
/* Free closure object */
|
||||
@@ -158,7 +153,8 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
generator->gc_buffer = NULL;
|
||||
}
|
||||
|
||||
efree(execute_data);
|
||||
efree(generator->execute_data);
|
||||
generator->execute_data = NULL;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -219,7 +215,7 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */
|
||||
if (finally_op_num) {
|
||||
zval *fast_call;
|
||||
|
||||
zend_generator_cleanup_unfinished_execution(generator, ex, finally_op_num);
|
||||
zend_generator_cleanup_unfinished_execution(generator, finally_op_num);
|
||||
|
||||
fast_call = ZEND_CALL_VAR(ex, ex->func->op_array.opcodes[finally_op_end].op1.var);
|
||||
Z_OBJ_P(fast_call) = EG(exception);
|
||||
@@ -827,10 +823,9 @@ try_again:
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (generator == orig_generator) {
|
||||
zend_generator_close(generator, 0);
|
||||
if (!EG(current_execute_data)) {
|
||||
zend_throw_exception_internal(NULL);
|
||||
} else if (EG(current_execute_data)->func &&
|
||||
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
|
||||
if (EG(current_execute_data) &&
|
||||
EG(current_execute_data)->func &&
|
||||
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
|
||||
zend_rethrow_exception(EG(current_execute_data));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1595,14 +1595,10 @@ static void zend_do_traits_property_binding(zend_class_entry *ce) /* {{{ */
|
||||
/* next: check for conflicts with current class */
|
||||
if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) {
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
/* Only free if shadow is coming from direct parent,
|
||||
* otherwise these weren't copied in the first place. */
|
||||
if (coliding_prop->ce == ce->parent) {
|
||||
zend_string_release_ex(coliding_prop->name, 0);
|
||||
if (coliding_prop->doc_comment) {
|
||||
zend_string_release_ex(coliding_prop->doc_comment, 0);
|
||||
}
|
||||
}
|
||||
zend_string_release_ex(coliding_prop->name, 0);
|
||||
if (coliding_prop->doc_comment) {
|
||||
zend_string_release_ex(coliding_prop->doc_comment, 0);
|
||||
}
|
||||
zend_hash_del(&ce->properties_info, prop_name);
|
||||
flags |= ZEND_ACC_CHANGED;
|
||||
} else {
|
||||
|
||||
@@ -310,7 +310,7 @@ static void zval_ini_dtor(zval *zv)
|
||||
%left '|' '&' '^'
|
||||
%right '~' '!'
|
||||
|
||||
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL cfg_var_ref constant_literal constant_string encapsed_list expr option_offset section_string_or_value string_or_value var_string_list var_string_list_section
|
||||
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL
|
||||
|
||||
%%
|
||||
|
||||
|
||||
+191
-210
File diff suppressed because it is too large.
Load diff
@@ -2098,7 +2098,7 @@ inline_char_handler:
|
||||
|
||||
if (YYCURSOR < YYLIMIT) {
|
||||
YYCURSOR++;
|
||||
} else if (!SCNG(heredoc_scan_ahead)) {
|
||||
} else {
|
||||
zend_error(E_COMPILE_WARNING, "Unterminated comment starting line %d", CG(zend_lineno));
|
||||
}
|
||||
|
||||
@@ -2323,9 +2323,6 @@ skip_escape_conversion:
|
||||
if (!IS_LABEL_SUCCESSOR(YYCURSOR[heredoc_label->length])) {
|
||||
if (spacing == (HEREDOC_USING_SPACES | HEREDOC_USING_TABS)) {
|
||||
zend_throw_exception(zend_ce_parse_error, "Invalid indentation - tabs and spaces cannot be mixed", 0);
|
||||
if (PARSER_MODE()) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
YYCURSOR = saved_cursor;
|
||||
@@ -2342,7 +2339,6 @@ skip_escape_conversion:
|
||||
zend_lex_state current_state;
|
||||
int heredoc_nesting_level = 1;
|
||||
int first_token = 0;
|
||||
int error = 0;
|
||||
|
||||
zend_save_lexical_state(¤t_state);
|
||||
|
||||
@@ -2390,7 +2386,6 @@ skip_escape_conversion:
|
||||
|| first_token == T_CURLY_OPEN
|
||||
) && SCNG(heredoc_indentation)) {
|
||||
zend_throw_exception_ex(zend_ce_parse_error, 0, "Invalid body indentation level (expecting an indentation level of at least %d)", SCNG(heredoc_indentation));
|
||||
error = 1;
|
||||
}
|
||||
|
||||
heredoc_label->indentation = SCNG(heredoc_indentation);
|
||||
@@ -2399,10 +2394,6 @@ skip_escape_conversion:
|
||||
zend_restore_lexical_state(¤t_state);
|
||||
SCNG(heredoc_scan_ahead) = 0;
|
||||
CG(increment_lineno) = 0;
|
||||
|
||||
if (PARSER_MODE() && error) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TOKEN(T_START_HEREDOC);
|
||||
@@ -2592,9 +2583,6 @@ double_quotes_scan_done:
|
||||
|
||||
if (spacing == (HEREDOC_USING_SPACES | HEREDOC_USING_TABS)) {
|
||||
zend_throw_exception(zend_ce_parse_error, "Invalid indentation - tabs and spaces cannot be mixed", 0);
|
||||
if (PARSER_MODE()) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/* newline before label will be subtracted from returned text, but
|
||||
@@ -2716,9 +2704,6 @@ heredoc_scan_done:
|
||||
|
||||
if (spacing == (HEREDOC_USING_SPACES | HEREDOC_USING_TABS)) {
|
||||
zend_throw_exception(zend_ce_parse_error, "Invalid indentation - tabs and spaces cannot be mixed", 0);
|
||||
if (PARSER_MODE()) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/* newline before label will be subtracted from returned text, but
|
||||
@@ -2767,9 +2752,7 @@ nowdoc_scan_done:
|
||||
RETURN_TOKEN(END);
|
||||
}
|
||||
|
||||
if (!SCNG(heredoc_scan_ahead)) {
|
||||
zend_error(E_COMPILE_WARNING, "Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
|
||||
}
|
||||
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
|
||||
goto restart;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 1.0.1 */
|
||||
/* Generated by re2c 1.1.1 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -1193,18 +1193,12 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
|
||||
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
if (op1 == result) {
|
||||
zval_ptr_dtor(result);
|
||||
}
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
op1 = zendi_convert_scalar_to_number(op1, &op1_copy, result, 0);
|
||||
}
|
||||
if (Z_TYPE_P(op2) == IS_ARRAY) {
|
||||
if (op1 == result) {
|
||||
zval_ptr_dtor(result);
|
||||
}
|
||||
ZVAL_LONG(result, 1L);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
@@ -1212,9 +1206,6 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
|
||||
}
|
||||
} else {
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
if (op1 == result) {
|
||||
zval_ptr_dtor(result);
|
||||
}
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
|
||||
@@ -90,10 +90,10 @@ ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const c
|
||||
ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end);
|
||||
|
||||
#if SIZEOF_ZEND_LONG == 4
|
||||
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) > (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN))
|
||||
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) > ZEND_LONG_MAX || (d) < ZEND_LONG_MIN))
|
||||
#else
|
||||
/* >= as (double)ZEND_LONG_MAX is outside signed range */
|
||||
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN))
|
||||
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= ZEND_LONG_MAX || (d) < ZEND_LONG_MIN))
|
||||
#endif
|
||||
|
||||
#if ZEND_DVAL_TO_LVAL_CAST_OK
|
||||
|
||||
+8
-15
@@ -741,10 +741,8 @@ ZEND_VM_COLD_CONST_HANDLER(13, ZEND_BOOL_NOT, CONST|TMPVAR|CV, ANY)
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -2398,9 +2396,9 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
|
||||
uint32_t call_info = EX_CALL_INFO();
|
||||
|
||||
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
|
||||
zend_object *object = Z_OBJ(execute_data->This);
|
||||
#if 0
|
||||
@@ -2426,12 +2424,12 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
|
||||
LOAD_NEXT_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
zend_clean_and_cache_symbol_table(EX(symbol_table));
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
|
||||
/* Free extra args before releasing the closure,
|
||||
* as that may free the op_array. */
|
||||
@@ -2481,7 +2479,6 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
|
||||
ZEND_VM_LEAVE();
|
||||
} else {
|
||||
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
@@ -2489,6 +2486,7 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
|
||||
}
|
||||
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
|
||||
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
|
||||
}
|
||||
@@ -3163,7 +3161,6 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, UNUSED|CLASS_FETCH|CONST|VAR,
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP2_TYPE != IS_CONST) {
|
||||
@@ -3344,11 +3341,11 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
call = NULL;
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if (OP2_TYPE & (IS_VAR|IS_TMP_VAR)) {
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (call) {
|
||||
@@ -3360,6 +3357,8 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -3860,10 +3859,6 @@ ZEND_VM_HOT_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -4850,10 +4845,8 @@ ZEND_VM_COLD_CONST_HANDLER(52, ZEND_BOOL, CONST|TMPVAR|CV, ANY)
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
|
||||
+19
-69
@@ -507,9 +507,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
uint32_t call_info = EX_CALL_INFO();
|
||||
|
||||
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
|
||||
zend_object *object = Z_OBJ(execute_data->This);
|
||||
#if 0
|
||||
@@ -535,12 +535,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
LOAD_NEXT_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
zend_clean_and_cache_symbol_table(EX(symbol_table));
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
|
||||
/* Free extra args before releasing the closure,
|
||||
* as that may free the op_array. */
|
||||
@@ -590,7 +590,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
ZEND_VM_LEAVE();
|
||||
} else {
|
||||
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
@@ -598,6 +597,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
}
|
||||
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
|
||||
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
|
||||
}
|
||||
@@ -2137,6 +2137,8 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2311,11 +2313,11 @@ try_function_name:
|
||||
call = NULL;
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (call) {
|
||||
@@ -2327,6 +2329,8 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2442,6 +2446,8 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2479,10 +2485,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CON
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -2727,10 +2731,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -3056,10 +3056,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_H
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -5211,7 +5209,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST != IS_CONST) {
|
||||
@@ -7393,7 +7390,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
@@ -8627,7 +8623,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_UNUSED != IS_CONST) {
|
||||
@@ -10495,7 +10490,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV != IS_CONST) {
|
||||
@@ -12103,10 +12097,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER(Z
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -12367,10 +12359,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_TMPVAR_HANDLER(ZEND_
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -17669,10 +17659,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -20441,10 +20427,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -23523,7 +23505,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST != IS_CONST) {
|
||||
@@ -25838,7 +25819,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
@@ -27398,7 +27378,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_UNUSED != IS_CONST) {
|
||||
@@ -29837,7 +29816,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV != IS_CONST) {
|
||||
@@ -31940,7 +31918,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST != IS_CONST) {
|
||||
@@ -33676,7 +33653,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
@@ -34215,7 +34191,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_UNUSED != IS_CONST) {
|
||||
@@ -36057,7 +36032,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV != IS_CONST) {
|
||||
@@ -36425,10 +36399,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -36887,10 +36859,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -37254,10 +37222,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCO
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -55379,9 +55345,9 @@ zend_leave_helper_SPEC_LABEL:
|
||||
uint32_t call_info = EX_CALL_INFO();
|
||||
|
||||
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
|
||||
zend_object *object = Z_OBJ(execute_data->This);
|
||||
#if 0
|
||||
@@ -55407,12 +55373,12 @@ zend_leave_helper_SPEC_LABEL:
|
||||
LOAD_NEXT_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
zend_clean_and_cache_symbol_table(EX(symbol_table));
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
|
||||
/* Free extra args before releasing the closure,
|
||||
* as that may free the op_array. */
|
||||
@@ -55462,7 +55428,6 @@ zend_leave_helper_SPEC_LABEL:
|
||||
ZEND_VM_LEAVE();
|
||||
} else {
|
||||
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
@@ -55470,6 +55435,7 @@ zend_leave_helper_SPEC_LABEL:
|
||||
}
|
||||
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
|
||||
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
|
||||
}
|
||||
@@ -55730,10 +55696,6 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -57348,10 +57310,6 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -57638,10 +57596,6 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -59284,10 +59238,6 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
|
||||
+1
-4
@@ -395,8 +395,6 @@ AC_DEFUN([PHP_EVAL_LIBLINE],[
|
||||
$2="[$]$2 -pthread"
|
||||
else
|
||||
PHP_RUN_ONCE(EXTRA_LDFLAGS, [$ac_i], [EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"])
|
||||
PHP_RUN_ONCE(EXTRA_LDFLAGS_PROGRAM, [$ac_i],
|
||||
[EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $ac_i"])
|
||||
fi
|
||||
;;
|
||||
-l*[)]
|
||||
@@ -2193,8 +2191,7 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
|
||||
ICU_LIBS=`$PKG_CONFIG --libs icu-uc icu-io icu-i18n`
|
||||
ICU_INCS=`$PKG_CONFIG --cflags-only-I icu-uc icu-io icu-i18n`
|
||||
ICU_CXXFLAGS=`$PKG_CONFIG --variable=CXXFLAGS icu-uc`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
ICU_CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
|
||||
|
||||
AC_MSG_RESULT([found $ICU_VERSION])
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
cscript /nologo /e:jscript win32\build\buildconf.js %*
|
||||
cscript /nologo win32\build\buildconf.js %*
|
||||
SET PHP_BUILDCONF_PATH=%~dp0
|
||||
copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul
|
||||
SET PHP_SDK_SCRIPT_PATH=
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=15
|
||||
PHP_RELEASE_VERSION=10
|
||||
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`
|
||||
|
||||
@@ -57,9 +57,9 @@ bc_str2num (bc_num *num, char *str, int scale)
|
||||
zero_int = FALSE;
|
||||
if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */
|
||||
while (*ptr == '0') ptr++; /* Skip leading zeros. */
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++, digits++; /* digits */
|
||||
while (isdigit((int)*ptr)) ptr++, digits++; /* digits */
|
||||
if (*ptr == '.') ptr++; /* decimal point */
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++, strscale++; /* digits */
|
||||
while (isdigit((int)*ptr)) ptr++, strscale++; /* digits */
|
||||
if ((*ptr != '\0') || (digits+strscale == 0))
|
||||
{
|
||||
*num = bc_copy_num (BCG(_zero_));
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78878 (Buffer underflow in bc_shift_addsub)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
print @bcmul("\xB26483605105519922841849335928742092", bcpowmod(2, 65535, -4e-4));
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
@@ -2,8 +2,6 @@
|
||||
easter_date()
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--ENV--
|
||||
TZ=UTC
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
|
||||
@@ -123,11 +123,6 @@ static void com_write_dimension(zval *object, zval *offset, zval *value)
|
||||
|
||||
obj = CDNO_FETCH(object);
|
||||
|
||||
if (offset == NULL) {
|
||||
php_com_throw_exception(DISP_E_BADINDEX, "appending to variants is not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
if (V_VT(&obj->v) == VT_DISPATCH) {
|
||||
ZVAL_COPY_VALUE(&args[0], offset);
|
||||
ZVAL_COPY_VALUE(&args[1], value);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78694 (Appending to a variant array causes segfault)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
foreach ([new com('WScript.Shell'), new variant([])] as $var) {
|
||||
try {
|
||||
$var[] = 42;
|
||||
} catch (com_exception $ex) {
|
||||
var_dump($ex->getMessage());
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(38) "appending to variants is not supported"
|
||||
string(38) "appending to variants is not supported"
|
||||
+1
-59
@@ -1452,10 +1452,6 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_TLS13_CIPHERS);
|
||||
#endif
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_HTTP09_ALLOWED);
|
||||
#endif
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x074001 /* Available since 7.64.1 */
|
||||
REGISTER_CURL_CONSTANT(CURL_VERSION_ALTSVC);
|
||||
#endif
|
||||
@@ -1848,11 +1844,7 @@ static void curl_free_string(void **string)
|
||||
*/
|
||||
static void curl_free_post(void **post)
|
||||
{
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
curl_mime_free((curl_mime *)*post);
|
||||
#else
|
||||
curl_formfree((struct HttpPost *)*post);
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2369,9 +2361,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x073d00 /* Available since 7.61.0 */
|
||||
case CURLOPT_DISALLOW_USERNAME_IN_URL:
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
|
||||
case CURLOPT_HTTP09_ALLOWED:
|
||||
#endif
|
||||
lval = zval_get_long(zvalue);
|
||||
#if LIBCURL_VERSION_NUM >= 0x071304
|
||||
@@ -2775,30 +2764,16 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
HashTable *postfields;
|
||||
zend_string *string_key;
|
||||
zend_ulong num_key;
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
curl_mime *mime = NULL;
|
||||
curl_mimepart *part;
|
||||
CURLcode form_error;
|
||||
#else
|
||||
struct HttpPost *first = NULL;
|
||||
struct HttpPost *last = NULL;
|
||||
CURLFORMcode form_error;
|
||||
#endif
|
||||
|
||||
postfields = HASH_OF(zvalue);
|
||||
if (!postfields) {
|
||||
php_error_docref(NULL, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
if (zend_hash_num_elements(postfields) > 0) {
|
||||
mime = curl_mime_init(ch->cp);
|
||||
if (mime == NULL) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL(postfields, num_key, string_key, current) {
|
||||
zend_string *postval, *tmp_postval;
|
||||
/* Pretend we have a string_key here */
|
||||
@@ -2833,20 +2808,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
|
||||
filename = Z_STRVAL_P(prop);
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
part = curl_mime_addpart(mime);
|
||||
if (part == NULL) {
|
||||
zend_string_release_ex(string_key, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK
|
||||
|| (form_error = curl_mime_filedata(part, ZSTR_VAL(postval))) != CURLE_OK
|
||||
|| (form_error = curl_mime_filename(part, filename ? filename : ZSTR_VAL(postval))) != CURLE_OK
|
||||
|| (form_error = curl_mime_type(part, type ? type : "application/octet-stream")) != CURLE_OK) {
|
||||
error = form_error;
|
||||
}
|
||||
#else
|
||||
form_error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, ZSTR_VAL(string_key),
|
||||
CURLFORM_NAMELENGTH, ZSTR_LEN(string_key),
|
||||
@@ -2858,7 +2819,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
/* Not nice to convert between enums but we only have place for one error type */
|
||||
error = (CURLcode)form_error;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
zend_string_release_ex(string_key, 0);
|
||||
@@ -2867,18 +2827,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
|
||||
postval = zval_get_tmp_string(current, &tmp_postval);
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
part = curl_mime_addpart(mime);
|
||||
if (part == NULL) {
|
||||
zend_tmp_string_release(tmp_postval);
|
||||
zend_string_release_ex(string_key, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK
|
||||
|| (form_error = curl_mime_data(part, ZSTR_VAL(postval), ZSTR_LEN(postval))) != CURLE_OK) {
|
||||
error = form_error;
|
||||
}
|
||||
#else
|
||||
/* The arguments after _NAMELENGTH and _CONTENTSLENGTH
|
||||
* must be explicitly cast to long in curl_formadd
|
||||
* use since curl needs a long not an int. */
|
||||
@@ -2893,7 +2841,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
/* Not nice to convert between enums but we only have place for one error type */
|
||||
error = (CURLcode)form_error;
|
||||
}
|
||||
#endif
|
||||
zend_tmp_string_release(tmp_postval);
|
||||
zend_string_release_ex(string_key, 0);
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
@@ -2906,13 +2853,8 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
if ((*ch->clone) == 1) {
|
||||
zend_llist_clean(&ch->to_free->post);
|
||||
}
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
zend_llist_add_element(&ch->to_free->post, &mime);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_MIMEPOST, mime);
|
||||
#else
|
||||
zend_llist_add_element(&ch->to_free->post, &first);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first);
|
||||
#endif
|
||||
} else {
|
||||
#if LIBCURL_VERSION_NUM >= 0x071101
|
||||
zend_string *tmp_str;
|
||||
|
||||
@@ -92,8 +92,6 @@ PHP_FUNCTION(curl_multi_add_handle)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
_php_curl_verify_handlers(ch, 1);
|
||||
|
||||
_php_curl_cleanup_handle(ch);
|
||||
|
||||
GC_ADDREF(Z_RES_P(z_ch));
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
Bug #45161 (Reusing a curl handle leaks memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
exit("skip not for Windows");
|
||||
}
|
||||
if (!extension_loaded("curl")) {
|
||||
exit("skip curl extension not loaded");
|
||||
}
|
||||
$curl_version = curl_version();
|
||||
if ($curl_version['version_number'] < 0x071100) {
|
||||
exit("skip: test works only with curl >= 7.17.0");
|
||||
@@ -10,12 +15,10 @@ if ($curl_version['version_number'] < 0x071100) {
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
|
||||
// Fill memory for test
|
||||
$ch = curl_init();
|
||||
$fp = fopen(PHP_OS_FAMILY === 'Windows' ? 'nul' : '/dev/null', 'w');
|
||||
$fp = fopen('/dev/null', 'w');
|
||||
|
||||
/*
|
||||
$i = $start = $end = 100000.00;
|
||||
@@ -29,7 +32,7 @@ for ($i = 0; $i < 100; $i++) {
|
||||
// Start actual test
|
||||
$start = memory_get_usage() + 1024;
|
||||
for($i = 0; $i < 1024; $i++) {
|
||||
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc");
|
||||
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/');
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
curl_exec($ch);
|
||||
}
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
Bug #46739 (array returned by curl_getinfo should contain content_type key)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (!extension_loaded("curl")) {
|
||||
exit("skip curl extension not loaded");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
$ch = curl_init("{$host}/get.inc");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$ch = curl_init('http://127.0.0.1:9/');
|
||||
|
||||
curl_exec($ch);
|
||||
$info = curl_getinfo($ch);
|
||||
|
||||
@@ -67,25 +67,25 @@ foreach($options_to_check as $option) {
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
|
||||
--EXPECTF--
|
||||
Warning: curl_multi_add_handle(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
%A
|
||||
Warning: curl_multi_add_handle(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
%A
|
||||
Ok for CURLOPT_STDERR
|
||||
|
||||
Warning: curl_multi_add_handle(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
|
||||
|
||||
Warning: curl_multi_add_handle(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
|
||||
Ok for CURLOPT_WRITEHEADER
|
||||
|
||||
Warning: curl_multi_add_handle(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
|
||||
Warning: curl_multi_add_handle(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
Hello World!
|
||||
Hello World!Hello World!
|
||||
Hello World!Ok for CURLOPT_FILE
|
||||
|
||||
Warning: curl_multi_add_handle(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
|
||||
|
||||
Warning: curl_multi_add_handle(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
|
||||
Ok for CURLOPT_INFILE
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78775: TLS issues from HTTP request affecting other encrypted connections
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) die('skip Requires curl');
|
||||
if (!extension_loaded('openssl')) die('skip Requires openssl');
|
||||
if (getenv('SKIP_ONLINE_TESTS')) die('skip Online test');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$sock = fsockopen("tls://google.com", 443);
|
||||
|
||||
var_dump($sock);
|
||||
|
||||
$handle = curl_init('https://self-signed.badssl.com/');
|
||||
curl_setopt_array(
|
||||
$handle,
|
||||
[
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_SSL_VERIFYPEER => true,
|
||||
]
|
||||
);
|
||||
|
||||
var_dump(curl_exec($handle));
|
||||
curl_close($handle);
|
||||
|
||||
fwrite($sock, "GET / HTTP/1.0\n\n");
|
||||
var_dump(fread($sock, 8));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
resource(%d) of type (stream)
|
||||
bool(false)
|
||||
string(8) "HTTP/1.0"
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79033 (Curl timeout error with specific url and post)
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_URL => "{$host}/get.inc?test=post",
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => [],
|
||||
CURLINFO_HEADER_OUT => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
]);
|
||||
var_dump(curl_exec($ch));
|
||||
var_dump(curl_getinfo($ch)["request_header"]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "array(0) {
|
||||
}
|
||||
"
|
||||
string(90) "POST /get.inc?test=post HTTP/1.1
|
||||
Host: localhost:%d
|
||||
Accept: */*
|
||||
Content-Length: 0
|
||||
|
||||
"
|
||||
+34
-21
@@ -144,7 +144,7 @@ void timelib_isodate_from_date(timelib_sll y, timelib_sll m, timelib_sll d, time
|
||||
*id = timelib_day_of_week_ex(y, m, d, 1);
|
||||
}
|
||||
|
||||
timelib_sll timelib_daynr_from_weeknr(timelib_sll iy, timelib_sll iw, timelib_sll id)
|
||||
static timelib_sll timelib_daynr_from_weeknr_ex(timelib_sll iy, timelib_sll iw, timelib_sll id, timelib_sll *y)
|
||||
{
|
||||
timelib_sll dow, day;
|
||||
|
||||
@@ -152,41 +152,54 @@ timelib_sll timelib_daynr_from_weeknr(timelib_sll iy, timelib_sll iw, timelib_sl
|
||||
dow = timelib_day_of_week(iy, 1, 1);
|
||||
/* then use that to figure out the offset for day 1 of week 1 */
|
||||
day = 0 - (dow > 4 ? dow - 7 : dow);
|
||||
/* and adjust the year to the natural year if we need to */
|
||||
*y = (iw == 1 && day < 0 && id < dow) ? iy - 1 : iy;
|
||||
|
||||
/* Add weeks and days */
|
||||
return day + ((iw - 1) * 7) + id;
|
||||
}
|
||||
|
||||
timelib_sll timelib_daynr_from_weeknr(timelib_sll iy, timelib_sll iw, timelib_sll id)
|
||||
{
|
||||
timelib_sll dummy_iso_year;
|
||||
|
||||
return timelib_daynr_from_weeknr_ex(iy, iw, id, &dummy_iso_year);
|
||||
}
|
||||
|
||||
void timelib_date_from_isodate(timelib_sll iy, timelib_sll iw, timelib_sll id, timelib_sll *y, timelib_sll *m, timelib_sll *d)
|
||||
{
|
||||
timelib_sll daynr = timelib_daynr_from_weeknr(iy, iw, id) + 1;
|
||||
timelib_sll daynr = timelib_daynr_from_weeknr_ex(iy, iw, id, y) + 1;
|
||||
int *table;
|
||||
bool is_leap_year;
|
||||
|
||||
// Invariant: is_leap_year == timelib_is_leap(*y)
|
||||
*y = iy;
|
||||
is_leap_year = timelib_is_leap(*y);
|
||||
*m = 0;
|
||||
|
||||
// Establish invariant that daynr >= 0
|
||||
while (daynr <= 0) {
|
||||
*y -= 1;
|
||||
daynr += (is_leap_year = timelib_is_leap(*y)) ? 366 : 365;
|
||||
}
|
||||
|
||||
// Establish invariant that daynr <= number of days in *yr
|
||||
while (daynr > (is_leap_year ? 366 : 365)) {
|
||||
daynr -= is_leap_year ? 366 : 365;
|
||||
if (daynr <= 0) {
|
||||
*y += 1;
|
||||
is_leap_year = timelib_is_leap(*y);
|
||||
}
|
||||
|
||||
table = is_leap_year ? ml_table_leap : ml_table_common;
|
||||
if (timelib_is_leap(*y)) {
|
||||
table = ml_table_leap;
|
||||
if (daynr > 366) {
|
||||
*y += 1;
|
||||
daynr -= 366;
|
||||
}
|
||||
} else {
|
||||
table = ml_table_common;
|
||||
if (daynr > 365) {
|
||||
*y += 1;
|
||||
daynr -= 365;
|
||||
}
|
||||
}
|
||||
|
||||
// Establish invariant that daynr <= number of days in *m
|
||||
*m = 1;
|
||||
while (daynr > table[*m]) {
|
||||
do {
|
||||
daynr -= table[*m];
|
||||
*m += 1;
|
||||
(*m)++;
|
||||
} while (daynr > table[*m]);
|
||||
|
||||
if (daynr <= 0) {
|
||||
daynr += 31;
|
||||
*y -= 1;
|
||||
*m = 12;
|
||||
}
|
||||
|
||||
*d = daynr;
|
||||
|
||||
@@ -322,9 +322,9 @@ typedef struct _timelib_tzdb {
|
||||
# define timelib_free free
|
||||
#endif
|
||||
|
||||
#define TIMELIB_VERSION 201803
|
||||
#define TIMELIB_EXTENDED_VERSION 20180301
|
||||
#define TIMELIB_ASCII_VERSION "2018.03"
|
||||
#define TIMELIB_VERSION 201802
|
||||
#define TIMELIB_EXTENDED_VERSION 20180201
|
||||
#define TIMELIB_ASCII_VERSION "2018.02"
|
||||
|
||||
#define TIMELIB_NONE 0x00
|
||||
#define TIMELIB_OVERRIDE_TIME 0x01
|
||||
|
||||
+1051
-1066
File diff suppressed because it is too large.
Load diff
@@ -33,6 +33,18 @@ static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 24
|
||||
static int days_in_month_leap[13] = { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
static void do_range_limit_fraction(timelib_sll *fraction, timelib_sll *seconds)
|
||||
{
|
||||
if (*fraction < 0) {
|
||||
*fraction += 1000000;
|
||||
*seconds -= 1;
|
||||
}
|
||||
if (*fraction >= 1000000) {
|
||||
*fraction -= 1000000;
|
||||
*seconds += 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
|
||||
{
|
||||
if (*a < start) {
|
||||
@@ -182,7 +194,7 @@ static void do_adjust_for_weekday(timelib_time* time)
|
||||
|
||||
void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt)
|
||||
{
|
||||
do_range_limit(0, 1000000, 1000000, &rt->us, &rt->s);
|
||||
do_range_limit_fraction(&rt->us, &rt->s);
|
||||
do_range_limit(0, 60, 60, &rt->s, &rt->i);
|
||||
do_range_limit(0, 60, 60, &rt->i, &rt->h);
|
||||
do_range_limit(0, 24, 24, &rt->h, &rt->d);
|
||||
@@ -222,7 +234,7 @@ static void magic_date_calc(timelib_time *time)
|
||||
|
||||
void timelib_do_normalize(timelib_time* time)
|
||||
{
|
||||
if (time->us != TIMELIB_UNSET) do_range_limit(0, 1000000, 1000000, &time->us, &time->s);
|
||||
if (time->us != TIMELIB_UNSET) do_range_limit_fraction(&time->us, &time->s);
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->s, &time->i);
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->i, &time->h);
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 24, 24, &time->h, &time->d);
|
||||
|
||||
+13
-30
@@ -2923,7 +2923,7 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
|
||||
zval tmp_obj;
|
||||
timelib_tzinfo *tzi;
|
||||
|
||||
z_date = zend_hash_str_find(myht, "date", sizeof("date")-1);
|
||||
z_date = zend_hash_str_find(myht, "date", sizeof("data")-1);
|
||||
if (z_date && Z_TYPE_P(z_date) == IS_STRING) {
|
||||
zval *z_timezone_type = zend_hash_str_find(myht, "timezone_type", sizeof("timezone_type")-1);
|
||||
if (z_timezone_type && Z_TYPE_P(z_timezone_type) == IS_LONG) {
|
||||
@@ -3297,7 +3297,6 @@ PHP_METHOD(DateTimeImmutable, modify)
|
||||
|
||||
date_clone_immutable(object, &new_object);
|
||||
if (!php_date_modify(&new_object, modify, modify_len)) {
|
||||
zval_ptr_dtor(&new_object);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -4360,20 +4359,6 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY_DAYS(member) \
|
||||
do { \
|
||||
zval *z_arg = zend_hash_str_find(myht, "days", sizeof("days") - 1); \
|
||||
if (z_arg && Z_TYPE_P(z_arg) == IS_FALSE) { \
|
||||
(*intobj)->diff->member = -99999; \
|
||||
} else if (z_arg && Z_TYPE_P(z_arg) <= IS_STRING) { \
|
||||
zend_string *str = zval_get_string(z_arg); \
|
||||
DATE_A64I((*intobj)->diff->member, ZSTR_VAL(str)); \
|
||||
zend_string_release(str); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = -1LL; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY_DOUBLE(element, member, def) \
|
||||
do { \
|
||||
zval *z_arg = zend_hash_str_find(myht, element, sizeof(element) - 1); \
|
||||
@@ -4390,21 +4375,19 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
|
||||
{
|
||||
do {
|
||||
zval *z_arg = zend_hash_str_find(myht, "f", sizeof("f") - 1);
|
||||
(*intobj)->diff->us = -1000000;
|
||||
if (z_arg) {
|
||||
double val = zval_get_double(z_arg) * 1000000;
|
||||
if (val >= 0 && val < 1000000) {
|
||||
(*intobj)->diff->us = val;
|
||||
}
|
||||
(*intobj)->diff->us = ((double)zval_get_double(z_arg) * 1000000);
|
||||
} else {
|
||||
(*intobj)->diff->us = (double) -1000000;
|
||||
}
|
||||
}
|
||||
} while (0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("invert", invert, int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_DAYS(days);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_I64("days", days);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_I64("special_amount", special.amount);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("have_weekday_relative", have_weekday_relative, unsigned int, 0);
|
||||
@@ -5171,7 +5154,7 @@ static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
|
||||
|
||||
if (period_obj->start) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(&zv, period_obj->start_ce);
|
||||
object_init_ex(&zv, date_ce_date);
|
||||
date_obj = Z_PHPDATE_P(&zv);
|
||||
date_obj->time = timelib_time_clone(period_obj->start);
|
||||
} else {
|
||||
@@ -5181,7 +5164,7 @@ static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
|
||||
|
||||
if (period_obj->current) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(&zv, period_obj->start_ce);
|
||||
object_init_ex(&zv, date_ce_date);
|
||||
date_obj = Z_PHPDATE_P(&zv);
|
||||
date_obj->time = timelib_time_clone(period_obj->current);
|
||||
} else {
|
||||
@@ -5191,7 +5174,7 @@ static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
|
||||
|
||||
if (period_obj->end) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(&zv, period_obj->start_ce);
|
||||
object_init_ex(&zv, date_ce_date);
|
||||
date_obj = Z_PHPDATE_P(&zv);
|
||||
date_obj->time = timelib_time_clone(period_obj->end);
|
||||
} else {
|
||||
@@ -5228,7 +5211,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
|
||||
|
||||
ht_entry = zend_hash_str_find(myht, "start", sizeof("start")-1);
|
||||
if (ht_entry) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && Z_OBJCE_P(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = Z_PHPDATE_P(ht_entry);
|
||||
period_obj->start = timelib_time_clone(date_obj->time);
|
||||
@@ -5242,7 +5225,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
|
||||
|
||||
ht_entry = zend_hash_str_find(myht, "end", sizeof("end")-1);
|
||||
if (ht_entry) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && Z_OBJCE_P(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = Z_PHPDATE_P(ht_entry);
|
||||
period_obj->end = timelib_time_clone(date_obj->time);
|
||||
@@ -5255,7 +5238,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
|
||||
|
||||
ht_entry = zend_hash_str_find(myht, "current", sizeof("current")-1);
|
||||
if (ht_entry) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && Z_OBJCE_P(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = Z_PHPDATE_P(ht_entry);
|
||||
period_obj->current = timelib_time_clone(date_obj->time);
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
DateTimeImmutable::modify() with invalid format
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$datetime = new DateTimeImmutable;
|
||||
var_dump($datetime->modify(''));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: DateTimeImmutable::modify(): Failed to parse time string () at position 0 ( in %s on line %d
|
||||
bool(false)
|
||||
@@ -39,7 +39,7 @@ DateInterval Object
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] =>
|
||||
[days] => 0
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
|
||||
@@ -136,7 +136,7 @@ object(DatePeriod)#%d (6) {
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
|
||||
@@ -71,7 +71,7 @@ object(DateInterval)#2 (16) {
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #70153 (\DateInterval incorrectly unserialized)
|
||||
--FILE--
|
||||
<?php
|
||||
$i1 = \DateInterval::createFromDateString('+1 month');
|
||||
$i2 = unserialize(serialize($i1));
|
||||
var_dump($i1->days, $i2->days);
|
||||
var_dump($i2->special_amount, $i2->special_amount);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
int(0)
|
||||
int(0)
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78751 (Serialising DatePeriod converts DateTimeImmutable)
|
||||
--FILE--
|
||||
<?php
|
||||
$oDay = new DateTimeImmutable('2019-10-25');
|
||||
$oDateInterval = DateInterval::createFromDateString('1 day');
|
||||
$oDays = new DatePeriod($oDay, $oDateInterval, $oDay->modify('+1 day'));
|
||||
$oDays = unserialize(serialize($oDays));
|
||||
var_dump(
|
||||
$oDays->start instanceof DateTimeImmutable,
|
||||
$oDays->end instanceof DateTimeImmutable
|
||||
);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79015 (undefined-behavior in php_date.c)
|
||||
--FILE--
|
||||
<?php
|
||||
$payload = 'O:12:"DateInterval":16:{s:1:"y";i:1;s:1:"m";i:0;s:1:"d";i:4;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";i:9999999999990;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";b:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}';
|
||||
var_dump(unserialize($payload));
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (16) {
|
||||
["y"]=>
|
||||
int(1)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(4)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["f"]=>
|
||||
float(-1)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -43,18 +43,10 @@ DBA_OPEN_FUNC(lmdb)
|
||||
MDB_env *env;
|
||||
MDB_txn *txn;
|
||||
int rc, mode = 0644, flags = MDB_NOSUBDIR;
|
||||
zend_long mapsize = 0;
|
||||
|
||||
if(info->argc > 0) {
|
||||
mode = zval_get_long(&info->argv[0]);
|
||||
|
||||
if (info->argc > 1) {
|
||||
mapsize = zval_get_long(&info->argv[1]);
|
||||
if (mapsize < 0) {
|
||||
*error = "mapsize must be greater than or equal to zero";
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
/* TODO implement handling of the additional flags. */
|
||||
}
|
||||
|
||||
@@ -64,14 +56,6 @@ DBA_OPEN_FUNC(lmdb)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (mapsize > 0) {
|
||||
rc = mdb_env_set_mapsize(env, (size_t) mapsize);
|
||||
if (rc) {
|
||||
*error = mdb_strerror(rc);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
rc = mdb_env_open(env, info->path, flags, mode);
|
||||
if (rc) {
|
||||
*error = mdb_strerror(rc);
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
$handler = 'lmdb';
|
||||
require_once __DIR__ .'/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = 'lmdb';
|
||||
require_once __DIR__ .'/test.inc';
|
||||
$lmdb_h = dba_open($db_filename, 'c', 'lmdb', 0644, 5*1048576);
|
||||
for ($i = 0; $i < 50000; $i++) {
|
||||
dba_insert('key' . $i, 'value '. $i, $lmdb_h);
|
||||
}
|
||||
dba_close($lmdb_h);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once dirname(__FILE__) .'/clean.inc';
|
||||
?>
|
||||
@@ -21,6 +21,6 @@ domdocumentloadxml_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): %rexpected '>'|Opening and ending tag mismatch: book line 5 and books%r %s
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): %rPremature end of data in tag books|EndTag: '<\/' not found in Entity, line: 13%r %s
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s
|
||||
@@ -21,6 +21,6 @@ domdocumentload_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): %rexpected '>'|Opening and ending tag mismatch: book line 5 and books%r %s
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): %rPremature end of data in tag books|EndTag: '<\/' not found%r %s
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s
|
||||
+49
-66
@@ -978,6 +978,7 @@ static tag_info_array tag_table_VND_PANASONIC = {
|
||||
{ 0x0001, "Quality"},
|
||||
{ 0x0002, "FirmwareVersion"},
|
||||
{ 0x0003, "WhiteBalance"},
|
||||
{ 0x0004, "0x0004"},
|
||||
{ 0x0007, "FocusMode"},
|
||||
{ 0x000f, "AFMode"},
|
||||
{ 0x001a, "ImageStabilization"},
|
||||
@@ -985,10 +986,12 @@ static tag_info_array tag_table_VND_PANASONIC = {
|
||||
{ 0x001f, "ShootingMode"},
|
||||
{ 0x0020, "Audio"},
|
||||
{ 0x0021, "DataDump"},
|
||||
{ 0x0022, "0x0022"},
|
||||
{ 0x0023, "WhiteBalanceBias"},
|
||||
{ 0x0024, "FlashBias"},
|
||||
{ 0x0025, "InternalSerialNumber"},
|
||||
{ 0x0026, "ExifVersion"},
|
||||
{ 0x0027, "0x0027"},
|
||||
{ 0x0028, "ColorEffect"},
|
||||
{ 0x0029, "TimeSincePowerOn"},
|
||||
{ 0x002a, "BurstMode"},
|
||||
@@ -996,6 +999,7 @@ static tag_info_array tag_table_VND_PANASONIC = {
|
||||
{ 0x002c, "Contrast"},
|
||||
{ 0x002d, "NoiseReduction"},
|
||||
{ 0x002e, "SelfTimer"},
|
||||
{ 0x002f, "0x002f"},
|
||||
{ 0x0030, "Rotation"},
|
||||
{ 0x0031, "AFAssistLamp"},
|
||||
{ 0x0032, "ColorMode"},
|
||||
@@ -1062,6 +1066,7 @@ static tag_info_array tag_table_VND_PANASONIC = {
|
||||
{ 0x00a3, "ClearRetouchValue"},
|
||||
{ 0x00ab, "TouchAE"},
|
||||
{ 0x0e00, "PrintIM"},
|
||||
{ 0x4449, "0x4449"},
|
||||
{ 0x8000, "MakerNoteVersion"},
|
||||
{ 0x8001, "SceneMode"},
|
||||
{ 0x8004, "WBRedLevel"},
|
||||
@@ -1096,20 +1101,22 @@ static tag_info_array tag_table_VND_SONY = {
|
||||
{ 0x0112, "WhiteBalanceFineTune"},
|
||||
{ 0x0114, "CameraSettings"},
|
||||
{ 0x0115, "WhiteBalance"},
|
||||
{ 0x0116, "ExtraInfo"},
|
||||
{ 0x0116, "0x0116"},
|
||||
{ 0x0e00, "PrintIM"},
|
||||
{ 0x1000, "MultiBurstMode"},
|
||||
{ 0x1001, "MultiBurstImageWidth"},
|
||||
{ 0x1002, "MultiBurstImageHeight"},
|
||||
{ 0x1003, "Panorama"},
|
||||
{ 0x2000, "0x2000"},
|
||||
{ 0x2001, "PreviewImage"},
|
||||
{ 0x2002, "Rating"},
|
||||
{ 0x2002, "0x2002"},
|
||||
{ 0x2003, "0x2003"},
|
||||
{ 0x2004, "Contrast"},
|
||||
{ 0x2005, "Saturation"},
|
||||
{ 0x2006, "Sharpness"},
|
||||
{ 0x2007, "Brightness"},
|
||||
{ 0x2008, "LongExposureNoiseReduction"},
|
||||
{ 0x2009, "HighISONoiseReduction"},
|
||||
{ 0x2006, "0x2006"},
|
||||
{ 0x2007, "0x2007"},
|
||||
{ 0x2008, "0x2008"},
|
||||
{ 0x2009, "0x2009"},
|
||||
{ 0x200a, "AutoHDR"},
|
||||
{ 0x3000, "ShotInfo"},
|
||||
{ 0xb000, "FileFormat"},
|
||||
@@ -1136,9 +1143,8 @@ static tag_info_array tag_table_VND_SONY = {
|
||||
{ 0xb049, "ReleaseMode"},
|
||||
{ 0xb04a, "SequenceNumber"},
|
||||
{ 0xb04b, "AntiBlur"},
|
||||
{ 0xb04e, "FocusMode"},
|
||||
{ 0xb04e, "LongExposureNoiseReduction"},
|
||||
{ 0xb04f, "DynamicRangeOptimizer"},
|
||||
{ 0xb050, "HighISONoiseReduction2"},
|
||||
{ 0xb052, "IntelligentAuto"},
|
||||
{ 0xb054, "WhiteBalance2"},
|
||||
TAG_TABLE_END
|
||||
@@ -1243,6 +1249,7 @@ static tag_info_array tag_table_VND_MINOLTA = {
|
||||
{ 0x0100, "SceneMode"},
|
||||
{ 0x0101, "ColorMode"},
|
||||
{ 0x0102, "Quality"},
|
||||
{ 0x0103, "0x0103"},
|
||||
{ 0x0104, "FlashExposureComp"},
|
||||
{ 0x0105, "Teleconverter"},
|
||||
{ 0x0107, "ImageStabilization"},
|
||||
@@ -1327,28 +1334,27 @@ typedef struct {
|
||||
|
||||
/* Remember to update PHP_MINFO if updated */
|
||||
static const maker_note_type maker_note_array[] = {
|
||||
{ tag_table_VND_CANON, "Canon", NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_CASIO, "CASIO", NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_FUJI, "FUJIFILM", "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_NIKON, "NIKON", "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_NIKON_990, "NIKON", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SAMSUNG, "SAMSUNG", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_PANASONIC, "Panasonic", "Panasonic\x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_DJI, "DJI", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SONY, "SONY", "SONY DSC \x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SONY, "SONY", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_PENTAX, "PENTAX", "AOC\x00", 6, 6, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_MINOLTA, "Minolta, KONICA MINOLTA", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "SIGMA\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "FOVEON\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_KYOCERA, "KYOCERA, CONTAX", "KYOCERA \x00\x00\x00", 22, 22, MN_ORDER_NORMAL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_RICOH, "RICOH", "Ricoh", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_RICOH, "RICOH", "RICOH", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_CANON, "Canon", NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_CASIO, "CASIO", NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_FUJI, "FUJIFILM", "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_NIKON, "NIKON", "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_NIKON_990, "NIKON", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SAMSUNG, "SAMSUNG", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_PANASONIC, "Panasonic", "Panasonic\x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_DJI, "DJI", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SONY, "SONY", "SONY DSC \x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_PENTAX, "PENTAX", "AOC\x00", 6, 6, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_MINOLTA, "Minolta, KONICA MINOLTA", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "SIGMA\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "FOVEON\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_KYOCERA, "KYOCERA, CONTAX", "KYOCERA \x00\x00\x00", 22, 22, MN_ORDER_NORMAL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_RICOH, "RICOH", "Ricoh", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_RICOH, "RICOH", "RICOH", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
|
||||
/* These re-uses existing formats */
|
||||
{ tag_table_VND_OLYMPUS, "AGFA", "AGFA \x00\x01", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "EPSON", "EPSON\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}
|
||||
{ tag_table_VND_OLYMPUS, "AGFA", "AGFA \x00\x01", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "EPSON", "EPSON\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -2297,11 +2303,14 @@ static void exif_iif_free(image_info_type *image_info, int section_index) {
|
||||
efree(f);
|
||||
}
|
||||
switch(image_info->info_list[section_index].list[i].format) {
|
||||
case TAG_FMT_UNDEFINED:
|
||||
case TAG_FMT_STRING:
|
||||
case TAG_FMT_SBYTE:
|
||||
case TAG_FMT_BYTE:
|
||||
/* in contrast to strings bytes do not need to allocate buffer for NULL if length==0 */
|
||||
if (image_info->info_list[section_index].list[i].length<1)
|
||||
break;
|
||||
default:
|
||||
case TAG_FMT_UNDEFINED:
|
||||
case TAG_FMT_STRING:
|
||||
if ((f=image_info->info_list[section_index].list[i].value.s) != NULL) {
|
||||
efree(f);
|
||||
}
|
||||
@@ -3138,8 +3147,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s)", maker_note->make?maker_note->make:"");*/
|
||||
if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make)))
|
||||
continue;
|
||||
if (maker_note->id_string && value_len >= maker_note->id_string_len
|
||||
&& strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
if (maker_note->id_string && strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
@@ -3213,9 +3221,8 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
}
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
size_t offset = 2 + 12 * de;
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + offset,
|
||||
offset_base, data_len - offset, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3228,14 +3235,6 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#define REQUIRE_NON_EMPTY() do { \
|
||||
if (byte_count == 0) { \
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Cannot be empty", tag, exif_get_tagname(tag, tagname, -12, tag_table)); \
|
||||
return FALSE; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* {{{ exif_process_IFD_TAG
|
||||
* Process one of the nested IFDs directories. */
|
||||
static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
|
||||
@@ -3269,6 +3268,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
/*return TRUE;*/
|
||||
}
|
||||
|
||||
if (components <= 0) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%d)", tag, exif_get_tagname(tag, tagname, -12, tag_table), components);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
byte_count_signed = (int64_t)components * php_tiff_bytes_per_format[format];
|
||||
|
||||
if (byte_count_signed < 0 || (byte_count_signed > INT32_MAX)) {
|
||||
@@ -3348,12 +3352,8 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
}
|
||||
#endif
|
||||
|
||||
/* NB: The following code may not assume that there is at least one component!
|
||||
* byte_count may be zero! */
|
||||
|
||||
if (section_index==SECTION_THUMBNAIL) {
|
||||
if (!ImageInfo->Thumbnail.data) {
|
||||
REQUIRE_NON_EMPTY();
|
||||
switch(tag) {
|
||||
case TAG_IMAGEWIDTH:
|
||||
case TAG_COMP_IMAGE_WIDTH:
|
||||
@@ -3397,9 +3397,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
if (byte_count>1 && (length=php_strnlen(value_ptr, byte_count)) > 0) {
|
||||
if (length<byte_count-1) {
|
||||
/* When there are any characters after the first NUL */
|
||||
EFREE_IF(ImageInfo->CopyrightPhotographer);
|
||||
EFREE_IF(ImageInfo->CopyrightEditor);
|
||||
EFREE_IF(ImageInfo->Copyright);
|
||||
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
|
||||
ImageInfo->CopyrightEditor = estrndup(value_ptr+length+1, byte_count-length-1);
|
||||
spprintf(&ImageInfo->Copyright, 0, "%s, %s", ImageInfo->CopyrightPhotographer, ImageInfo->CopyrightEditor);
|
||||
@@ -3407,7 +3404,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
/* but we are not supposed to change this */
|
||||
/* keep in mind that image_info does not store editor value */
|
||||
} else {
|
||||
EFREE_IF(ImageInfo->Copyright);
|
||||
ImageInfo->Copyright = estrndup(value_ptr, byte_count);
|
||||
}
|
||||
}
|
||||
@@ -3436,7 +3432,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
case TAG_FNUMBER:
|
||||
/* Simplest way of expressing aperture, so I trust it the most.
|
||||
(overwrite previously computed value if there is one) */
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
|
||||
break;
|
||||
|
||||
@@ -3445,7 +3440,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
/* More relevant info always comes earlier, so only use this field if we don't
|
||||
have appropriate aperture information yet. */
|
||||
if (ImageInfo->ApertureFNumber == 0) {
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->ApertureFNumber
|
||||
= (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)*0.5);
|
||||
}
|
||||
@@ -3457,7 +3451,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
SHUTTERSPEED comes after EXPOSURE TIME
|
||||
*/
|
||||
if (ImageInfo->ExposureTime == 0) {
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->ExposureTime
|
||||
= (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)));
|
||||
}
|
||||
@@ -3467,24 +3460,20 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
break;
|
||||
|
||||
case TAG_COMP_IMAGE_WIDTH:
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, exif_rewrite_tag_format_to_unsigned(format), ImageInfo->motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FOCALPLANE_X_RES:
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_SUBJECT_DISTANCE:
|
||||
/* Inidcates the distacne the autofocus camera is focused to.
|
||||
Tends to be less accurate as distance increases. */
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FOCALPLANE_RESOLUTION_UNIT:
|
||||
REQUIRE_NON_EMPTY();
|
||||
switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)) {
|
||||
case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */
|
||||
case 2:
|
||||
@@ -3510,11 +3499,9 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
break;
|
||||
|
||||
case TAG_MAKE:
|
||||
EFREE_IF(ImageInfo->make);
|
||||
ImageInfo->make = estrndup(value_ptr, byte_count);
|
||||
break;
|
||||
case TAG_MODEL:
|
||||
EFREE_IF(ImageInfo->model);
|
||||
ImageInfo->model = estrndup(value_ptr, byte_count);
|
||||
break;
|
||||
|
||||
@@ -3529,7 +3516,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
case TAG_GPS_IFD_POINTER:
|
||||
case TAG_INTEROP_IFD_POINTER:
|
||||
if (ReadNextIFD) {
|
||||
REQUIRE_NON_EMPTY();
|
||||
char *Subdir_start;
|
||||
int sub_section_index = 0;
|
||||
switch(tag) {
|
||||
@@ -3558,11 +3544,9 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
Subdir_start = offset_base + php_ifd_get32u(value_ptr, ImageInfo->motorola_intel);
|
||||
if (Subdir_start < offset_base || Subdir_start > offset_base+IFDlength) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
|
||||
EFREE_IF(outside);
|
||||
return FALSE;
|
||||
}
|
||||
if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index, tag)) {
|
||||
EFREE_IF(outside);
|
||||
return FALSE;
|
||||
}
|
||||
#ifdef EXIF_DEBUG
|
||||
@@ -4573,9 +4557,8 @@ PHP_FUNCTION(exif_read_data)
|
||||
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth", "%dmm", (int)ImageInfo.CCDWidth);
|
||||
}
|
||||
if(ImageInfo.ExposureTime>0) {
|
||||
float recip_exposure_time = 0.5f + 1.0f/ImageInfo.ExposureTime;
|
||||
if (ImageInfo.ExposureTime <= 0.5 && recip_exposure_time < INT_MAX) {
|
||||
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int) recip_exposure_time);
|
||||
if(ImageInfo.ExposureTime <= 0.5) {
|
||||
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
|
||||
} else {
|
||||
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s", ImageInfo.ExposureTime);
|
||||
}
|
||||
|
||||
@@ -4,48 +4,9 @@ Bug #68547 (Exif Header component value check error)
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_read_data(__DIR__ . DIRECTORY_SEPARATOR . 'bug68547.jpg'));
|
||||
exif_read_data(__DIR__ . DIRECTORY_SEPARATOR . 'bug68547.jpg');
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
array(12) {
|
||||
["FileName"]=>
|
||||
string(12) "bug68547.jpg"
|
||||
["FileDateTime"]=>
|
||||
int(%d)
|
||||
["FileSize"]=>
|
||||
int(713)
|
||||
["FileType"]=>
|
||||
int(2)
|
||||
["MimeType"]=>
|
||||
string(10) "image/jpeg"
|
||||
["SectionsFound"]=>
|
||||
string(20) "ANY_TAG, IFD0, WINXP"
|
||||
["COMPUTED"]=>
|
||||
array(5) {
|
||||
["html"]=>
|
||||
string(20) "width="1" height="1""
|
||||
["Height"]=>
|
||||
int(1)
|
||||
["Width"]=>
|
||||
int(1)
|
||||
["IsColor"]=>
|
||||
int(1)
|
||||
["ByteOrderMotorola"]=>
|
||||
int(0)
|
||||
}
|
||||
["Subject"]=>
|
||||
string(10) "Subjec??.."
|
||||
["Keywords"]=>
|
||||
string(0) ""
|
||||
["Author"]=>
|
||||
string(9) "Rui Carmo"
|
||||
["Comments"]=>
|
||||
string(29) "Comments
|
||||
Line2
|
||||
Line3
|
||||
Line4"
|
||||
["Title"]=>
|
||||
string(8) "Title..."
|
||||
}
|
||||
Warning: exif_read_data(bug68547.jpg): Process tag(x9C9E=Keywords ): Illegal components(%d) in %sbug68547.php on line %d
|
||||
===DONE===
|
||||
@@ -39,6 +39,7 @@ print_r(exif_read_data(__DIR__.'/bug68799.jpg'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug68799.jpg): Process tag(x9C9D=Author ): Illegal components(%d) in %s on line %d
|
||||
Array
|
||||
(
|
||||
[FileName] => bug68799.jpg
|
||||
@@ -46,7 +47,7 @@ Array
|
||||
[FileSize] => 735
|
||||
[FileType] => 2
|
||||
[MimeType] => image/jpeg
|
||||
[SectionsFound] => ANY_TAG, IFD0, WINXP
|
||||
[SectionsFound] => ANY_TAG, IFD0
|
||||
[COMPUTED] => Array
|
||||
(
|
||||
[html] => width="1" height="1"
|
||||
@@ -59,5 +60,4 @@ Array
|
||||
[XResolution] => 96/1
|
||||
[YResolution] => 96/1
|
||||
[ResolutionUnit] => 2
|
||||
[Author] =>
|
||||
)
|
||||
@@ -47,7 +47,7 @@ Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal
|
||||
|
||||
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug72094_3.jpg): Illegal IFD size in %s%ebug72094.php on line %d
|
||||
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal components(%d) in %s%ebug72094.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug72094_3.jpg): File structure corrupted in %s%ebug72094.php on line %d
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Bug #73737 (Crash when parsing a tag format)
|
||||
var_dump($exif);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_thumbnail(bug73737.tiff): Process tag(x0100=ImageWidth ): Cannot be empty in %s on line %d
|
||||
Warning: exif_thumbnail(bug73737.tiff): Process tag(x0100=ImageWidth ): Illegal components(0) in %s on line %d
|
||||
|
||||
Warning: exif_thumbnail(bug73737.tiff): Error in TIFF: filesize(x0030) less than start of IFD dir(x10102) in %s line %d
|
||||
bool(false)
|
||||
@@ -70,7 +70,7 @@ Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal f
|
||||
|
||||
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 > %s) 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
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78793: Use-after-free in exif parsing under memory sanitizer
|
||||
--FILE--
|
||||
<?php
|
||||
$f = "ext/exif/tests/bug77950.tiff";
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
@exif_read_data($f);
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78910: Heap-buffer-overflow READ in exif (OSS-Fuzz #19044)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(exif_read_data('data:image/jpg;base64,TU0AKgAAAAwgICAgAAIBDwAEAAAAAgAAACKSfCAgAAAAAEZVSklGSUxN'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: exif_read_data(): Read from TIFF: tag(0x927C, MakerNote ): Illegal format code 0x2020, switching to BYTE in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Process tag(x927C=MakerNote ): Illegal format code 0x2020, suppose BYTE in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): IFD data too short: 0x0000 offset 0x000C in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Invalid TIFF file in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
OSS-Fuzz #17474: Memory leak on duplicate Copyright tags
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) {
|
||||
die('skip exif extension not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// Only checking for an absence of leaks here.
|
||||
@exif_read_data(__DIR__ . '/duplicate_copyright_tag_leak.tiff');
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
OSS-Fuzz #17163: Out-of-bounds read due to tag with zero components
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) {
|
||||
die('skip exif extension not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(exif_read_data(__DIR__ . '/tag_with_illegal_zero_components.jpeg'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(tag_with_illegal_zero_components.jpeg): Process tag(x0202=JPEGInterch): Cannot be empty in %s on line %d
|
||||
|
||||
Warning: exif_read_data(tag_with_illegal_zero_components.jpeg): File structure corrupted in %s on line %d
|
||||
|
||||
Warning: exif_read_data(tag_with_illegal_zero_components.jpeg): Invalid JPEG file in %s on line %d
|
||||
bool(false)
|
||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
OSS-Fuzz: Temporary buffer leak in tag reading
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) {
|
||||
die('skip exif extension not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(@exif_read_data(__DIR__ . '/temporary_buffer_leak.jpg'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
OSS-Fuzz: Memory leak for zero-length MAKERNOTE
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) {
|
||||
die('skip exif extension not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@exif_read_data(__DIR__ . '/zero_length_makernote_leak.tiff');
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
Binary file not shown.
@@ -989,9 +989,8 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
||||
goto out;
|
||||
}
|
||||
nelements = CDF_GETUINT32(q, 1);
|
||||
if (nelements > CDF_ELEMENT_LIMIT || nelements == 0) {
|
||||
DPRINTF(("CDF_VECTOR with nelements == %"
|
||||
SIZE_T_FORMAT "u\n", nelements));
|
||||
if (nelements == 0) {
|
||||
DPRINTF(("CDF_VECTOR with nelements == 0\n"));
|
||||
goto out;
|
||||
}
|
||||
slen = 2;
|
||||
@@ -1033,6 +1032,8 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
||||
goto out;
|
||||
inp += nelem;
|
||||
}
|
||||
DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n",
|
||||
nelements));
|
||||
for (j = 0; j < nelements && i < sh.sh_properties;
|
||||
j++, i++)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
typedef int32_t cdf_secid_t;
|
||||
|
||||
#define CDF_LOOP_LIMIT 10000
|
||||
#define CDF_ELEMENT_LIMIT 100000
|
||||
|
||||
#define CDF_SECID_NULL 0
|
||||
#define CDF_SECID_FREE -1
|
||||
|
||||
@@ -477,9 +477,11 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
zend_string *repl;
|
||||
size_t rep_cnt = 0;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
|
||||
opts |= PCRE2_MULTILINE;
|
||||
convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts);
|
||||
if ((pce = pcre_get_compiled_regex_cache_ex(Z_STR(patt), 0)) == NULL) {
|
||||
if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
|
||||
zval_ptr_dtor(&patt);
|
||||
rep_cnt = -1;
|
||||
goto out;
|
||||
@@ -501,6 +503,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
zend_string_release_ex(res, 0);
|
||||
|
||||
out:
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
return rep_cnt;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,24 +116,14 @@ cdf_app_to_mime(const char *vbuf, const struct nv *nv)
|
||||
{
|
||||
size_t i;
|
||||
const char *rv = NULL;
|
||||
char *vbuf_lower;
|
||||
|
||||
vbuf_lower = zend_str_tolower_dup(vbuf, strlen(vbuf));
|
||||
for (i = 0; nv[i].pattern != NULL; i++) {
|
||||
char *pattern_lower;
|
||||
int found;
|
||||
|
||||
pattern_lower = zend_str_tolower_dup(nv[i].pattern, strlen(nv[i].pattern));
|
||||
found = (strstr(vbuf_lower, pattern_lower) != NULL);
|
||||
efree(pattern_lower);
|
||||
|
||||
if (found) {
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
for (i = 0; nv[i].pattern != NULL; i++)
|
||||
if (strcasestr(vbuf, nv[i].pattern) != NULL) {
|
||||
rv = nv[i].mime;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
efree(vbuf_lower);
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -422,25 +422,27 @@ flush:
|
||||
private int
|
||||
check_fmt(struct magic_set *ms, const char *fmt)
|
||||
{
|
||||
pcre_cache_entry *pce;
|
||||
pcre2_code *pce;
|
||||
uint32_t re_options, capture_count;
|
||||
int rv = -1;
|
||||
zend_string *pattern;
|
||||
|
||||
if (strchr(fmt, '%') == NULL)
|
||||
return 0;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
pattern = zend_string_init("~%[-0-9\\.]*s~", sizeof("~%[-0-9\\.]*s~") - 1, 0);
|
||||
if ((pce = pcre_get_compiled_regex_cache_ex(pattern, 0)) == NULL) {
|
||||
if ((pce = pcre_get_compiled_regex(pattern, &capture_count, &re_options)) == NULL) {
|
||||
rv = -1;
|
||||
} else {
|
||||
pcre2_code *re = php_pcre_pce_re(pce);
|
||||
pcre2_match_data *match_data = php_pcre_create_match_data(0, re);
|
||||
pcre2_match_data *match_data = php_pcre_create_match_data(capture_count, pce);
|
||||
if (match_data) {
|
||||
rv = pcre2_match(re, (PCRE2_SPTR)fmt, strlen(fmt), 0, 0, match_data, php_pcre_mctx()) > 0;
|
||||
rv = pcre2_match(pce, (PCRE2_SPTR)fmt, strlen(fmt), 0, re_options, match_data, php_pcre_mctx()) > 0;
|
||||
php_pcre_free_match_data(match_data);
|
||||
}
|
||||
}
|
||||
zend_string_release(pattern);
|
||||
zend_string_release_ex(pattern, 0);
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74170 locale information change after mime_content_type
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!class_exists('finfo'))
|
||||
die('skip no fileinfo extension');
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (setlocale(LC_CTYPE, 'ru_RU.koi8r') === false)
|
||||
die('skip ru_RU.koi8r locale is not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(setlocale(LC_CTYPE, 'ru_RU.koi8r'));
|
||||
var_dump(nl_langinfo(CODESET));
|
||||
var_dump(mime_content_type(__DIR__ . '/resources/test.ppt'));
|
||||
var_dump(nl_langinfo(CODESET));
|
||||
--EXPECT--
|
||||
string(11) "ru_RU.koi8r"
|
||||
string(6) "KOI8-R"
|
||||
string(29) "application/vnd.ms-powerpoint"
|
||||
string(6) "KOI8-R"
|
||||
@@ -264,7 +264,6 @@ int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, flo
|
||||
for ( y=0; y<src->sy; y++) {
|
||||
for(x=0; x<src->sx; x++) {
|
||||
new_r = new_g = new_b = 0;
|
||||
pxl = f(srcback, x, y);
|
||||
new_a = gdImageAlpha(srcback, pxl);
|
||||
|
||||
for (j=0; j<3; j++) {
|
||||
|
||||
@@ -534,7 +534,7 @@ compress(int init_bits, gdIOCtxPtr outfile, gdImagePtr im, GifCtx *ctx)
|
||||
output( (code_int)ctx->ClearCode, ctx );
|
||||
|
||||
#ifdef SIGNED_COMPARE_SLOW
|
||||
while ( (c = GIFNextPixel( im, ctx )) != (unsigned) EOF ) {
|
||||
while ( (c = GIFNextPixel( im )) != (unsigned) EOF ) {
|
||||
#else /*SIGNED_COMPARE_SLOW*/
|
||||
while ( (c = GIFNextPixel( im, ctx )) != EOF ) { /* } */
|
||||
#endif /*SIGNED_COMPARE_SLOW*/
|
||||
|
||||
@@ -2334,7 +2334,7 @@ int gdTransformAffineGetImage(gdImagePtr *dst,
|
||||
* src_area - Rectangular region to rotate in the src image
|
||||
*
|
||||
* Returns:
|
||||
* GD_TRUE on success or GD_FALSE on failure
|
||||
* GD_TRUE if the affine is rectilinear or GD_FALSE
|
||||
*/
|
||||
int gdTransformAffineCopy(gdImagePtr dst,
|
||||
int dst_x, int dst_y,
|
||||
@@ -2351,7 +2351,7 @@ int gdTransformAffineCopy(gdImagePtr dst,
|
||||
gdPointF pt, src_pt;
|
||||
gdRect bbox;
|
||||
int end_x, end_y;
|
||||
gdInterpolationMethod interpolation_id_bak = src->interpolation_id;
|
||||
gdInterpolationMethod interpolation_id_bak = GD_DEFAULT;
|
||||
interpolation_method interpolation_bak;
|
||||
|
||||
/* These methods use special implementations */
|
||||
@@ -2393,10 +2393,7 @@ int gdTransformAffineCopy(gdImagePtr dst,
|
||||
end_y = bbox.height + (int) fabs(bbox.y);
|
||||
|
||||
/* Get inverse affine to let us work with destination -> source */
|
||||
if (gdAffineInvert(inv, affine) == GD_FALSE) {
|
||||
gdImageSetInterpolationMethod(src, interpolation_id_bak);
|
||||
return GD_FALSE;
|
||||
}
|
||||
gdAffineInvert(inv, affine);
|
||||
|
||||
src_offset_x = src_region->x;
|
||||
src_offset_y = src_region->y;
|
||||
|
||||
@@ -55,7 +55,7 @@ int gdAffineApplyToPointF (gdPointFPtr dst, const gdPointFPtr src,
|
||||
* <gdAffineIdentity>
|
||||
*
|
||||
* Returns:
|
||||
* GD_TRUE on success or GD_FALSE on failure
|
||||
* GD_TRUE if the affine is rectilinear or GD_FALSE
|
||||
*/
|
||||
int gdAffineInvert (double dst[6], const double src[6])
|
||||
{
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
--TEST--
|
||||
Bug #47946 (ImageConvolution overwrites background)
|
||||
--DESCRIPTION--
|
||||
The expected image has black pixel artifacts, what is another issue, though
|
||||
(perhaps #40158).
|
||||
--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 fix not yet released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 396 B |
@@ -3,7 +3,7 @@ Bug #77198 (auto cropping has insufficient precision)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #77198 (threshold cropping has insufficient precision)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #77200 (imagecropauto(…, GD_CROP_SIDES) crops left but not right)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79067 (gdTransformAffineCopy() may use unitialized values)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$matrix = [1, 1, 1, 1, 1, 1];
|
||||
$src = imagecreatetruecolor(8, 8);
|
||||
var_dump(imageaffine($src, $matrix));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
Loaded 100 of 365 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user