]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.1' into PHP-7.2
authorDmitry Stogov <dmitry@zend.com>
Fri, 1 Dec 2017 14:00:51 +0000 (17:00 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 1 Dec 2017 14:00:51 +0000 (17:00 +0300)
* PHP-7.1:
  Set trailing zero

1  2 
Zend/zend_compile.c

index 0772bc4f1e94b1da6dc63ebbfe3f54f840042cca,8cb69009dfa25c05ff107dd568e3fce4d4fabe33..629d695144c3ca7d939c8b0b1b5222d7df822472
@@@ -6558,11 -6261,9 +6558,11 @@@ void zend_compile_use(zend_ast *ast) /
                        zend_string *ns_name = zend_string_alloc(ZSTR_LEN(current_ns) + 1 + ZSTR_LEN(new_name), 0);
                        zend_str_tolower_copy(ZSTR_VAL(ns_name), ZSTR_VAL(current_ns), ZSTR_LEN(current_ns));
                        ZSTR_VAL(ns_name)[ZSTR_LEN(current_ns)] = '\\';
-                       memcpy(ZSTR_VAL(ns_name) + ZSTR_LEN(current_ns) + 1, ZSTR_VAL(lookup_name), ZSTR_LEN(lookup_name));
+                       memcpy(ZSTR_VAL(ns_name) + ZSTR_LEN(current_ns) + 1, ZSTR_VAL(lookup_name), ZSTR_LEN(lookup_name) + 1);
  
 -                      zend_check_use_conflict(type, old_name, new_name, ns_name);
 +                      if (zend_have_seen_symbol(ns_name, type)) {
 +                              zend_check_already_in_use(type, old_name, new_name, ns_name);
 +                      }
  
                        zend_string_free(ns_name);
                } else {