]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.4' into PHP-5.5
authorStanislav Malyshev <stas@php.net>
Tue, 12 May 2015 21:24:15 +0000 (14:24 -0700)
committerStanislav Malyshev <stas@php.net>
Tue, 12 May 2015 21:24:15 +0000 (14:24 -0700)
* 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

1  2 
Zend/zend_alloc.c
Zend/zend_operators.c
ext/ftp/ftp.c
ext/pcntl/pcntl.c
ext/phar/tar.c
ext/standard/basic_functions.c
ext/standard/dir.c
ext/standard/file.c
ext/standard/pack.c
ext/standard/string.c
main/rfc1867.c

Simple merge
Simple merge
diff --cc ext/ftp/ftp.c
Simple merge
index bace3b056e265c0ed09ce13b6063b99c1ea9e21b,6189bdf5d61a31a68f974f6262d29b85457a7153..975b7f8108950e383020dfa74c713222b715dcea
@@@ -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/phar/tar.c
Simple merge
Simple merge
Simple merge
Simple merge
index a874b7ace96e918b0cdf8c87beee270abc5f874c,20c7bf04628fdcb78f4772579e215bac4c8751af..69fa675193e028ceae36dcbf91c9e6a2444f5167
@@@ -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);
                                INC_OUTPUTPOS((arg + (arg % 2)) / 2,1)  /* 4 bit per arg */
                                break;
  
-                       case 'a': 
+                       case 'a':
                        case 'A':
-                       case 'c': 
 +                      case 'Z':
+                       case 'c':
                        case 'C':
                        case 'x':
                                INC_OUTPUTPOS(arg,1)            /* 8 bit per arg */
                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;
Simple merge
diff --cc main/rfc1867.c
index 2c182025a2f5570fdc55d9f4dcb02680d6ca6b3d,9e2fbd52ebc79ee0ea895146c58fd49e9376b9c3..86101dc817daa1cda937e0410e454152f3ac1125
@@@ -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)) {