]> granicus.if.org Git - php/commitdiff
Removed extra byte
authorIlia Alshanetsky <iliaa@php.net>
Mon, 7 Aug 2006 16:54:16 +0000 (16:54 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 7 Aug 2006 16:54:16 +0000 (16:54 +0000)
ext/filter/filter.c

index 1eeef2def2bc74b519ebe951d74ae56f7203c395..8efd4af601e61f9d02b6a5c24e5e2b73d45cc636 100644 (file)
@@ -362,7 +362,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int
                /* FIXME: Should not use php_register_variable_ex as that also registers
                 * globals when register_globals is turned on */
                Z_STRLEN(raw_var) = val_len;
-               Z_STRVAL(raw_var) = estrndup(*val, val_len + 1);
+               Z_STRVAL(raw_var) = estrndup(*val, val_len);
                Z_TYPE(raw_var) = IS_STRING;
 
                php_register_variable_ex(var, &raw_var, array_ptr TSRMLS_CC);
@@ -376,7 +376,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int
                Z_TYPE(new_var) = IS_STRING;
 
                if (!(IF_G(default_filter) == FILTER_UNSAFE_RAW)) {
-                       Z_STRVAL(new_var) = estrndup(*val, val_len + 1);
+                       Z_STRVAL(new_var) = estrndup(*val, val_len);
                        php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL/*charset*/ TSRMLS_CC);
                }
 #if PHP_VERSION_ID<60000
@@ -385,7 +385,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int
                }
 #endif
                else {
-                       Z_STRVAL(new_var) = estrndup(*val, val_len + 1);
+                       Z_STRVAL(new_var) = estrndup(*val, val_len);
                }
        } else { /* empty string */
                ZVAL_EMPTY_STRING(&new_var);
@@ -404,7 +404,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int
                }
                efree(*val);
                if (Z_STRLEN(new_var)) {
-                       *val = estrndup(Z_STRVAL(new_var), Z_STRLEN(new_var) + 1);
+                       *val = estrndup(Z_STRVAL(new_var), Z_STRLEN(new_var));
                } else {
                        *val = estrdup("");
                }