Browse Source

Improve fix for bug #73807

At least on some architectures memmove() on FreeBSD does not
short-curcuit if src==dst. Check for it explicitly to avoid
quadratic copying.
pull/2401/head
Nikita Popov 10 years ago
parent
commit
bbfa1b6419
  1. 2
      main/php_variables.c

2
main/php_variables.c

@ -311,7 +311,7 @@ static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof)
}
}
if (!eof) {
if (!eof && ZSTR_VAL(vars->str.s) != vars->ptr) {
memmove(ZSTR_VAL(vars->str.s), vars->ptr, ZSTR_LEN(vars->str.s) = vars->end - vars->ptr);
}
return SUCCESS;

Loading…
Cancel
Save