com php-src: Remove outdate checks: ext/session/session.c ext/session/tests/bug72681.phpt
| From: | Xinchen Hui | Date: | Thu, 18 Aug 2016 07:37:15 +0000 |
| Subject: | com php-src: Remove outdate checks: ext/session/session.c ext/session/tests/bug72681.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93932@lists.php.net to get a copy of this message | ||
Commit: a3740dadecec9d47cde6055996e2ca13dd10c4f6
Author: Xinchen Hui <laruence@gmail.com> Thu, 18 Aug 2016 15:37:15 +0800
Parents: 1685282a158e5c92a7e84aed703355d27774d018
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a3740dadecec9d47cde6055996e2ca13dd10c4f6
Log:
Remove outdate checks
Changed paths:
M ext/session/session.c
M ext/session/tests/bug72681.phpt
Diff:
diff --git a/ext/session/session.c b/ext/session/session.c
index b303b90..9668db4 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -835,7 +835,6 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */
PHP_VAR_UNSERIALIZE_INIT(var_hash);
for (p = val; p < endptr; ) {
- zval *tmp;
skip = 0;
namelen = ((unsigned char)(*p)) & (~PS_BIN_UNDEF);
@@ -850,13 +849,6 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */
p += namelen + 1;
- if ((tmp = zend_hash_find(&EG(symbol_table), name))) {
- if ((Z_TYPE_P(tmp) == IS_ARRAY &&
- Z_ARRVAL_P(tmp) == &EG(symbol_table)) || tmp == &PS(http_session_vars)) {
- skip = 1;
- }
- }
-
if (has_value) {
zval *current, rv;
current = var_tmp_var(&var_hash);
@@ -933,7 +925,6 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */
p = val;
while (p < endptr) {
- zval *tmp;
q = p;
skip = 0;
while (*q != PS_DELIMITER) {
@@ -950,13 +941,6 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */
name = zend_string_init(p, namelen, 0);
q++;
- if ((tmp = zend_hash_find(&EG(symbol_table), name))) {
- if ((Z_TYPE_P(tmp) == IS_ARRAY &&
- Z_ARRVAL_P(tmp) == &EG(symbol_table)) || tmp == &PS(http_session_vars)) {
- skip = 1;
- }
- }
-
if (has_value) {
zval *current, rv;
current = var_tmp_var(&var_hash);
diff --git a/ext/session/tests/bug72681.phpt b/ext/session/tests/bug72681.phpt
index ceca6ec..4752767 100644
--- a/ext/session/tests/bug72681.phpt
+++ b/ext/session/tests/bug72681.phpt
@@ -6,12 +6,17 @@ Bug #72681: PHP Session Data Injection Vulnerability
<?php
ini_set('session.serialize_handler', 'php');
session_start();
-$GLOBALS['ryat'] = $GLOBALS;
+$GLOBALS['ryat'] = $_SESSION;
$_SESSION['ryat'] = 'ryat|O:8:"stdClass":0:{}';
session_write_close();
session_start();
+var_dump($ryat);
var_dump($_SESSION);
?>
--EXPECT--
array(0) {
}
+array(1) {
+ ["ryat"]=>
+ string(24) "ryat|O:8:"stdClass":0:{}"
+}