summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-05-01 13:23:57 +0200
committerAnatol Belski <ab@php.net>2016-05-01 13:23:57 +0200
commit965ff1c9bb62be990fc5b57cb975f1b277fb5445 (patch)
treebef0a6865d30f36d00a7714e3bdc0881b4b593ef
parentd9f321c6acee6c68ab77fd97ad1b8a1fdc3dcc09 (diff)
parent359af7c64bd47cb3723c4c4fa6cb338018a24360 (diff)
downloadphp-git-965ff1c9bb62be990fc5b57cb975f1b277fb5445.tar.gz
Merge branch 'master' of git.php.net:php-src
-rw-r--r--Zend/tests/dynamic_fully_qualified_call.phpt15
-rw-r--r--Zend/zend_compile.c1
-rw-r--r--ext/posix/posix.c2
3 files changed, 17 insertions, 1 deletions
diff --git a/Zend/tests/dynamic_fully_qualified_call.phpt b/Zend/tests/dynamic_fully_qualified_call.phpt
new file mode 100644
index 0000000000..cca6fa38b6
--- /dev/null
+++ b/Zend/tests/dynamic_fully_qualified_call.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Crash when using dynamic call syntax with fully qualified name in a namespace
+--FILE--
+<?php
+
+namespace Foo;
+try {
+ ('\bar')();
+} catch (\Error $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+--EXPECT--
+Call to undefined function bar()
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index c64e40bfd9..23781ba423 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -871,6 +871,7 @@ zend_string *zend_resolve_non_class_name(
if (ZSTR_VAL(name)[0] == '\\') {
/* Remove \ prefix (only relevant if this is a string rather than a label) */
+ *is_fully_qualified = 1;
return zend_string_init(ZSTR_VAL(name) + 1, ZSTR_LEN(name) - 1, 0);
}
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 25cb26f372..771e316325 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -987,7 +987,7 @@ int php_posix_group_to_array(struct group *g, zval *array_group) /* {{{ */
array_init(&array_members);
add_assoc_string(array_group, "name", g->gr_name);
- if (array_group->gr_passwd) {
+ if (g->gr_passwd) {
add_assoc_string(array_group, "passwd", g->gr_passwd);
} else {
add_assoc_null(array_group, "passwd");