com php-src: Fix bug #73144 and bug #73341 - remove extra dtor: ext/standard/tests/serialize/bug73341.phpt
| From: | Anatol Belski | Date: | Tue, 01 Nov 2016 12:01:58 +0000 |
| Subject: | com php-src: Fix bug #73144 and bug #73341 - remove extra dtor: ext/standard/tests/serialize/bug73341.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95439@lists.php.net to get a copy of this message | ||
Commit: 7cf7920055d44da72529b4277e6890c99cf1932e
Author: Stanislav Malyshev <stas@php.net> Sun, 23 Oct 2016 21:56:35 -0700
Committer: Anatol Belski <ab@php.net> Tue, 1 Nov 2016 13:01:58 +0100
Parents: 6b21c28b0e82d760f0c3c4da89dae8d2fb685e1b
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7cf7920055d44da72529b4277e6890c99cf1932e
Log:
Fix bug #73144 and bug #73341 - remove extra dtor
(cherry picked from commit f74d7d92c8bc1edc2505e0b58546217e9e1ecb40)
Conflicts:
ext/spl/spl_array.c
Merged the test only, in 7.0 tree the removed dtor call is already
not present.
Bugs:
https://bugs.php.net/73144
https://bugs.php.net/73341
Changed paths:
A ext/standard/tests/serialize/bug73341.phpt
Diff:
diff --git a/ext/standard/tests/serialize/bug73341.phpt b/ext/standard/tests/serialize/bug73341.phpt
new file mode 100644
index 0000000..5542321
--- /dev/null
+++ b/ext/standard/tests/serialize/bug73341.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #73144 (Use-afte-free in ArrayObject Deserialization)
+--FILE--
+<?php
+try {
+$token =
'a:2:{i:0;O:1:"0":2:0s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:0x:i:0;r0';
+$obj = unserialize($token);
+} catch(Exception $e) {
+ echo $e->getMessage()."\n";
+}
+
+try {
+$inner = 'x:i:1;O:8:"stdClass":1:{};m:a:0:{}';
+$exploit =
'C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}';
+unserialize($exploit);
+} catch(Exception $e) {
+ echo $e->getMessage()."\n";
+}
+?>
+--EXPECTF--
+Error at offset 6 of 7 bytes
+
+Notice: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d
+Error at offset 24 of 34 bytes
\ No newline at end of file