com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_a lloc.c Zend/zend_operators.c ext/ftp/ftp.c ext/pc ntl/pcntl.c ext/phar/tar.c
ext/standard/basic_functio ns.c ext/standard/dir.c ext/standard/file.c ext/sta ndard/pack.c ext/standard/string.c main/rfc1867 .c
| From: | Stanislav Malyshev | Date: | Tue, 12 May 2015 21:24:15 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_a lloc.c Zend/zend_operators.c ext/ftp/ftp.c ext/pc ntl/pcntl.c ext/phar/tar.c ext/standard/basic_functio ns.c ext/standard/dir.c ext/standard/file.c ext/sta ndard/pack.c ext/standard/string.c main/rfc1867 .c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86714@lists.php.net to get a copy of this message | ||
Commit: c08f9c2c786b0f7cbb401c18f6634cb5773f5baf
Author: Stanislav Malyshev <stas@php.net> Tue, 12 May 2015 14:24:15 -0700
Parents: c117548ea9365adac00960fe5f43425b2955310d f473ea5464361848f6fc45a8456c78de6d9f53c6
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c08f9c2c786b0f7cbb401c18f6634cb5773f5baf
Log:
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
fix format
update NEWS
Add test for bug #69522
Update tests
Fix bug #69522 - do not allow int overflow
Forgot test file
Fix bug #69403 and other int overflows
Fixed bug #69418 - more s->p fixes for filenames
Fixed bug #69364 - use smart_str to assemble strings
Fix bug #69453 - don't try to cut empty string
Fix bug #69545 - avoid overflow when reading list
Conflicts:
ext/pcntl/pcntl.c
ext/standard/basic_functions.c
ext/standard/pack.c
ext/standard/tests/dir/opendir_variation1-win32.phpt
Bugs:
https://bugs.php.net/69522
https://bugs.php.net/69403
https://bugs.php.net/69418
https://bugs.php.net/69364
https://bugs.php.net/69453
https://bugs.php.net/69545
Changed paths:
MM Zend/zend_alloc.c
MM Zend/zend_operators.c
MM ext/ftp/ftp.c
MM ext/pcntl/pcntl.c
MM ext/phar/tar.c
MM ext/standard/basic_functions.c
MM ext/standard/dir.c
MM ext/standard/file.c
MM ext/standard/pack.c
MM ext/standard/string.c
MM main/rfc1867.c
Diff:
diff --cc ext/pcntl/pcntl.c
index bace3b0,6189bdf..975b7f8
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@@ -878,10 -878,9 +878,10 @@@ PHP_FUNCTION(pcntl_signal
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal");
RETURN_FALSE;
}
+ zend_hash_index_del(&PCNTL_G(php_signal_table), signo);
RETURN_TRUE;
}
-
+
if (!zend_is_callable(handle, 0, &func_name TSRMLS_CC)) {
PCNTL_G(last_error) = EINVAL;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a callable function name
error", func_name);
@@@ -1278,11 -1272,9 +1278,11 @@@ void pcntl_signal_dispatch(
queue = next;
}
+ PCNTL_G(pending_signals) = 0;
+
/* Re-enable queue */
PCNTL_G(processing_signal_queue) = 0;
-
+
/* return signal mask to previous state */
sigprocmask(SIG_SETMASK, &old_mask, NULL);
}
diff --cc ext/standard/pack.c
index a874b7a,20c7bf0..69fa675
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@@ -168,10 -168,9 +168,10 @@@ PHP_FUNCTION(pack
break;
/* Always uses one arg */
- case 'a':
- case 'A':
- case 'Z':
- case 'h':
+ case 'a':
+ case 'A':
++ case 'Z':
+ case 'h':
case 'H':
if (currentarg >= num_args) {
efree(argv);
@@@ -255,10 -248,9 +255,10 @@@
INC_OUTPUTPOS((arg + (arg % 2)) / 2,1) /* 4 bit per arg */
break;
- case 'a':
+ case 'a':
case 'A':
+ case 'Z':
- case 'c':
+ case 'c':
case 'C':
case 'x':
INC_OUTPUTPOS(arg,1) /* 8 bit per arg */
@@@ -321,23 -313,20 +321,23 @@@
zval **val;
switch ((int) code) {
- case 'a':
- case 'A':
+ case 'a':
+ case 'A':
- memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg);
+ case 'Z': {
+ int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
+ memset(&output[outputpos], (code == 'a' || code == 'Z') ?
'\0' : ' ', arg);
val = argv[currentarg++];
if (Z_ISREF_PP(val)) {
SEPARATE_ZVAL(val);
}
convert_to_string_ex(val);
memcpy(&output[outputpos], Z_STRVAL_PP(val),
- (Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val) : arg);
+ (Z_STRLEN_PP(val) < arg_cp) ? Z_STRLEN_PP(val) : arg_cp);
outputpos += arg;
break;
+ }
- case 'h':
+ case 'h':
case 'H': {
int nibbleshift = (code == 'h') ? 0 : 4;
int first = 1;
@@@ -595,9 -584,8 +595,9 @@@ PHP_FUNCTION(unpack
size = 0;
break;
- case 'a':
+ case 'a':
case 'A':
+ case 'Z':
size = arg;
arg = 1;
break;
diff --cc main/rfc1867.c
index 2c18202,9e2fbd5..86101dc
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@@ -408,10 -410,9 +410,9 @@@ static int multipart_buffer_headers(mul
/* get lines of text, or CRLF_CRLF */
- while( (line = get_line(self TSRMLS_CC)) && strlen(line) > 0 )
+ while( (line = get_line(self TSRMLS_CC)) && line[0] != '\0' )
{
/* add header to table */
- char *key = line;
char *value = NULL;
if (php_rfc1867_encoding_translation(TSRMLS_C)) {