]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0'
authorStanislav Malyshev <stas@php.net>
Tue, 19 Jul 2016 08:44:14 +0000 (01:44 -0700)
committerStanislav Malyshev <stas@php.net>
Tue, 19 Jul 2016 08:44:14 +0000 (01:44 -0700)
* PHP-7.0: (27 commits)
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not allow reading past error read
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  update NEWS
  Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72551 and bug #72552 - check before converting size_t->int
  Fix bug #72541 - size_t overflow lead to heap corruption
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  Fix for bug #72513
  CS fix and comments with bug ID
  ...

Conflicts:
ext/standard/basic_functions.c

1  2 
ext/bz2/bz2.c
ext/curl/interface.c
ext/exif/exif.c
ext/intl/locale/locale_methods.c
ext/mcrypt/mcrypt.c
ext/session/session.c
ext/snmp/snmp.c
ext/standard/basic_functions.c
ext/zip/zip_stream.c
main/SAPI.c
main/php_variables.c

diff --cc ext/bz2/bz2.c
Simple merge
Simple merge
diff --cc ext/exif/exif.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc ext/snmp/snmp.c
Simple merge
index fd1596e5cdf07faecc0f5e23787acce810ca6a94,c4505886d6aa8955db13ac0c66bf8b166686110f..1cef26c3ae54c23f77200d122d41613be1941e75
@@@ -4019,31 -4009,27 +4019,34 @@@ PHP_FUNCTION(long2ip
   * System Functions *
   ********************/
  
- /* {{{ proto string getenv([string varname])
 -/* {{{ proto string getenv(string varname[, bool local_only])
 -   Get the value of an environment variable */
++/* {{{ proto string getenv(string varname[, bool local_only]
 +   Get the value of an environment variable or every available environment variable 
 +   if no varname is present  */
  PHP_FUNCTION(getenv)
  {
 -      char *ptr, *str;
 +      char *ptr, *str = NULL;
        size_t str_len;
+       zend_bool local_only = 0;
  
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &str, &str_len) == FAILURE) {
 -      if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &str, &str_len, &local_only) == FAILURE) {
++      if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sb", &str, &str_len, &local_only) == FAILURE) {
                RETURN_FALSE;
        }
  
-       /* SAPI method returns an emalloc()'d string */
-       ptr = sapi_getenv(str, str_len);
-       if (ptr) {
-               // TODO: avoid realocation ???
-               RETVAL_STRING(ptr);
-               efree(ptr);
-               return;
 +      if (!str) {
 +              array_init(return_value);
 +              php_import_environment_variables(return_value);
 +              return;
 +      }
 +
+       if (!local_only) {
+               /* SAPI method returns an emalloc()'d string */
+               ptr = sapi_getenv(str, str_len);
+               if (ptr) {
+                       // TODO: avoid realocation ???
+                       RETVAL_STRING(ptr);
+                       efree(ptr);
+                       return;
+               }
        }
  #ifdef PHP_WIN32
        {
Simple merge
diff --cc main/SAPI.c
Simple merge
Simple merge