Merge remote-tracking branch 'php/master'

This commit is contained in:
Anatol Belski 2014-08-20 08:48:43 +02:00
commit 07359785c3
5 changed files with 46 additions and 7 deletions

3
NEWS
View File

@ -16,6 +16,9 @@ PHP NEWS
- DBA:
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
- FPM:
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)
- Standard:
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
. Fix user session handlers (See rfc:session.user.return-value). (Sara)

View File

@ -35,6 +35,8 @@ PHP X.Y UPGRADE NOTES
3. Changes in SAPI modules
========================================
- FPM
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes).
========================================
4. Deprecated Functionality

View File

@ -4551,6 +4551,9 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
if (!Z_IMMUTABLE_P(array_ptr)) {
Z_DELREF_P(array_ptr);
}
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);

View File

@ -3165,6 +3165,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
if (!Z_IMMUTABLE_P(array_ptr)) {
Z_DELREF_P(array_ptr);
}
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);
@ -8685,6 +8688,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
if (!Z_IMMUTABLE_P(array_ptr)) {
Z_DELREF_P(array_ptr);
}
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);
@ -14128,6 +14134,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
if (!Z_IMMUTABLE_P(array_ptr)) {
Z_DELREF_P(array_ptr);
}
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);
@ -31489,6 +31498,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
(Z_ISREF_P(array_ref) &&
Z_REFCOUNTED_P(array_ptr) &&
Z_REFCOUNT_P(array_ptr) > 1)) {
if (!Z_IMMUTABLE_P(array_ptr)) {
Z_DELREF_P(array_ptr);
}
zval_copy_ctor(array_ptr);
}
Z_ADDREF_P(array_ref);

View File

@ -1476,7 +1476,8 @@ static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback
int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */
{
int error = 0;
char buf[1024+1];
char *buf = NULL, *newbuf = NULL;
int bufsize = 0;
int fd, n;
int nb_read = 1;
char c = '*';
@ -1503,19 +1504,36 @@ int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */
ini_lineno = 0;
while (nb_read > 0) {
int tmp;
memset(buf, 0, sizeof(char) * (1024 + 1));
for (n = 0; n < 1024 && (nb_read = read(fd, &c, sizeof(char))) == sizeof(char) && c != '\n'; n++) {
buf[n] = c;
}
buf[n++] = '\n';
ini_lineno++;
ini_filename = filename;
for (n = 0; (nb_read = read(fd, &c, sizeof(char))) == sizeof(char) && c != '\n'; n++) {
if (n == bufsize) {
bufsize += 1024;
newbuf = (char*) realloc(buf, sizeof(char) * (bufsize + 2));
if (newbuf == NULL) {
ini_recursion--;
close(fd);
free(buf);
return -1;
}
buf = newbuf;
}
buf[n] = c;
}
if (n == 0) {
continue;
}
/* always append newline and null terminate */
buf[n++] = '\n';
buf[n] = '\0';
tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error TSRMLS_CC);
ini_filename = filename;
if (error || tmp == FAILURE) {
if (ini_include) free(ini_include);
ini_recursion--;
close(fd);
free(buf);
return -1;
}
if (ini_include) {
@ -1527,16 +1545,17 @@ int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */
free(tmp);
ini_recursion--;
close(fd);
free(buf);
return -1;
}
free(tmp);
}
}
free(buf);
ini_recursion--;
close(fd);
return ret;
}
/* }}} */