mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix bug #73807
This commit is contained in:
parent
570a273807
commit
a15bffd105
2 changed files with 12 additions and 2 deletions
4
NEWS
4
NEWS
|
@ -2,6 +2,10 @@ PHP NEWS
|
||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||
?? ??? 2017 PHP 7.0.17
|
?? ??? 2017 PHP 7.0.17
|
||||||
|
|
||||||
|
- Core:
|
||||||
|
. Fixed bug #73807 (Performance problem with processing large post request).
|
||||||
|
(Nikita)
|
||||||
|
|
||||||
- OpenSSL:
|
- OpenSSL:
|
||||||
. Fixed bug #74022 (PHP Fast CGI crashes when reading from a pfx file).
|
. Fixed bug #74022 (PHP Fast CGI crashes when reading from a pfx file).
|
||||||
(Anatol)
|
(Anatol)
|
||||||
|
|
|
@ -239,11 +239,14 @@ typedef struct post_var_data {
|
||||||
char *ptr;
|
char *ptr;
|
||||||
char *end;
|
char *end;
|
||||||
uint64_t cnt;
|
uint64_t cnt;
|
||||||
|
|
||||||
|
/* Bytes in ptr that have already been scanned for '&' */
|
||||||
|
size_t already_scanned;
|
||||||
} post_var_data_t;
|
} post_var_data_t;
|
||||||
|
|
||||||
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
|
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
|
||||||
{
|
{
|
||||||
char *ksep, *vsep, *val;
|
char *start, *ksep, *vsep, *val;
|
||||||
size_t klen, vlen;
|
size_t klen, vlen;
|
||||||
size_t new_vlen;
|
size_t new_vlen;
|
||||||
|
|
||||||
|
@ -251,9 +254,11 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
vsep = memchr(var->ptr, '&', var->end - var->ptr);
|
start = var->ptr + var->already_scanned;
|
||||||
|
vsep = memchr(start, '&', var->end - start);
|
||||||
if (!vsep) {
|
if (!vsep) {
|
||||||
if (!eof) {
|
if (!eof) {
|
||||||
|
var->already_scanned = var->end - var->ptr;
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
vsep = var->end;
|
vsep = var->end;
|
||||||
|
@ -286,6 +291,7 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
|
||||||
efree(val);
|
efree(val);
|
||||||
|
|
||||||
var->ptr = vsep + (vsep != var->end);
|
var->ptr = vsep + (vsep != var->end);
|
||||||
|
var->already_scanned = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue