Fix non-zero terminated strings

This commit is contained in:
Dmitry Stogov 2014-02-21 18:14:47 +04:00
parent ca729cb4e3
commit b2e7b89041
3 changed files with 148 additions and 146 deletions

View File

@ -2239,7 +2239,7 @@ void zend_resolve_class_name(znode *class_name TSRMLS_DC) /* {{{ */
/* This is a compound class name that contains namespace prefix */
if (Z_STRVAL(class_name->u.constant)[0] == '\\') {
/* The STRING name has "\" prefix */
memmove(Z_STRVAL(class_name->u.constant), Z_STRVAL(class_name->u.constant)+1, Z_STRLEN(class_name->u.constant)-1);
memmove(Z_STRVAL(class_name->u.constant), Z_STRVAL(class_name->u.constant)+1, Z_STRLEN(class_name->u.constant));
Z_STR(class_name->u.constant) = STR_REALLOC(
Z_STR(class_name->u.constant),
Z_STRLEN(class_name->u.constant) - 1, 0);

File diff suppressed because it is too large Load Diff

View File

@ -1632,6 +1632,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
memcpy(Z_STRVAL_P(zendlval) + len, CG(active_op_array)->function_name->val, CG(active_op_array)->function_name->len);
len += CG(active_op_array)->function_name->len;
}
Z_STRVAL_P(zendlval)[len] = 0;
} else if (CG(active_op_array) && CG(active_op_array)->function_name) {
ZVAL_STR(zendlval, STR_COPY(CG(active_op_array)->function_name));
} else {