]> granicus.if.org Git - php/log
php
5 years agoDon't force USE_ZEND_ALLOC=0 in run-tests.php
Nikita Popov [Mon, 24 Jun 2019 13:41:03 +0000 (15:41 +0200)]
Don't force USE_ZEND_ALLOC=0 in run-tests.php

USE_ZEND_ALLOC=0 is useful not just for valgrind ... we should not
force USE_ZEND_ALLOC=1 if the user explicitly disabled it.

5 years agoFix region leak in mb_ereg_replace
Nikita Popov [Mon, 24 Jun 2019 07:30:59 +0000 (09:30 +0200)]
Fix region leak in mb_ereg_replace

5 years agoFixed bug 78175 (Preloading must store default values of static variables and properties)
Dmitry Stogov [Mon, 24 Jun 2019 17:32:27 +0000 (20:32 +0300)]
Fixed bug 78175 (Preloading must store default values of static variables and properties)

5 years agoSplit test case
Christoph M. Becker [Sun, 23 Jun 2019 11:54:42 +0000 (13:54 +0200)]
Split test case

This test is failing on AppVeyor almost all of the time, so splitting
it seems appropriate.  This also allows us to rid php_cli_server_stop()
which was only used by this test case.

5 years agoAdd debugging code to time_sleep_until test
Nikita Popov [Sat, 22 Jun 2019 08:19:49 +0000 (10:19 +0200)]
Add debugging code to time_sleep_until test

5 years agoMerge branch 'bug67348-mysqli-stat' into PHP-7.4
Derick Rethans [Fri, 21 Jun 2019 15:52:15 +0000 (16:52 +0100)]
Merge branch 'bug67348-mysqli-stat' into PHP-7.4

5 years agoFixed bug #67348: Reading $dbc->stat modifies $dbc->affected_rows
Derick Rethans [Fri, 21 Jun 2019 15:50:40 +0000 (16:50 +0100)]
Fixed bug #67348: Reading $dbc->stat modifies $dbc->affected_rows

5 years agoFix stack leak in phpdbg
Nikita Popov [Fri, 21 Jun 2019 14:52:08 +0000 (16:52 +0200)]
Fix stack leak in phpdbg

5 years agoFix prompt leak in phpdbg
Nikita Popov [Fri, 21 Jun 2019 13:56:02 +0000 (15:56 +0200)]
Fix prompt leak in phpdbg

5 years agoProperly shut down font cache mutex
Christoph M. Becker [Fri, 21 Jun 2019 11:50:19 +0000 (13:50 +0200)]
Properly shut down font cache mutex

Since the font cache mutex in set up in MINIT, we have to shut it down
in MSHUTDOWN.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Andrey Hristov [Fri, 21 Jun 2019 13:33:01 +0000 (16:33 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Andrey Hristov [Fri, 21 Jun 2019 13:32:13 +0000 (16:32 +0300)]
Merge branch 'PHP-7.2' into PHP-7.3

5 years agoAdd explicit cast to uint32_t.
Andrey Hristov [Fri, 21 Jun 2019 13:30:25 +0000 (16:30 +0300)]
Add explicit cast to uint32_t.

It works even without it but explicit stuff is better. The compiler probably converts the 16-bit
uint16_t to uint32_t before doing the shift.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 21 Jun 2019 13:08:12 +0000 (15:08 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Fri, 21 Jun 2019 13:07:59 +0000 (15:07 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

5 years agoFix PKCS12 leak in openssl
Nikita Popov [Fri, 21 Jun 2019 13:00:25 +0000 (15:00 +0200)]
Fix PKCS12 leak in openssl

5 years agoFix d leak in ecc openssl_pkey_new
Nikita Popov [Fri, 21 Jun 2019 12:43:15 +0000 (14:43 +0200)]
Fix d leak in ecc openssl_pkey_new

5 years agoFix netscape spki leak in openssl
Nikita Popov [Fri, 21 Jun 2019 12:35:35 +0000 (14:35 +0200)]
Fix netscape spki leak in openssl

5 years agoFix X509 leak in openssl_pkcs7_verify()
Nikita Popov [Fri, 21 Jun 2019 12:24:00 +0000 (14:24 +0200)]
Fix X509 leak in openssl_pkcs7_verify()

5 years agoFix CSR leaks in openssl
Nikita Popov [Fri, 21 Jun 2019 12:17:05 +0000 (14:17 +0200)]
Fix CSR leaks in openssl

5 years agoFree cert in php_openssl_load_stream_cafile()
Nikita Popov [Fri, 21 Jun 2019 12:03:06 +0000 (14:03 +0200)]
Free cert in php_openssl_load_stream_cafile()

X509_STORE_add_cert() increments the refcount of the cert, so we
should free it here.

5 years agoFix memory leaks in browscap parsing
Nikita Popov [Fri, 21 Jun 2019 10:10:09 +0000 (12:10 +0200)]
Fix memory leaks in browscap parsing

Also make the interning a bit more efficient, no need to check for
a "real" interned string every time, we can also store that in the
HT.

5 years agoFix leak in bcpowmod
Nikita Popov [Fri, 21 Jun 2019 10:17:42 +0000 (12:17 +0200)]
Fix leak in bcpowmod

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 21 Jun 2019 10:56:12 +0000 (12:56 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Fri, 21 Jun 2019 10:55:12 +0000 (12:55 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

5 years agoFix memory leak in TLS matches_san_list
Niklas Keller [Fri, 3 Aug 2018 19:00:14 +0000 (21:00 +0200)]
Fix memory leak in TLS matches_san_list

5 years agoCleanup
Dmitry Stogov [Fri, 21 Jun 2019 08:43:17 +0000 (11:43 +0300)]
Cleanup

5 years agoMake ZEND_SEND_* flags unsigned
Nikita Popov [Fri, 21 Jun 2019 08:21:35 +0000 (10:21 +0200)]
Make ZEND_SEND_* flags unsigned

These may be shifted to the limit for the arg mask.

5 years agoAvoid ub in shift overflow check
Nikita Popov [Fri, 21 Jun 2019 07:52:43 +0000 (09:52 +0200)]
Avoid ub in shift overflow check

Also fix an off-by-one error. While 1 << 63 overflows, -1 << 63 does
not.

5 years agoSupport TGA reading
Christoph M. Becker [Thu, 20 Jun 2019 21:40:51 +0000 (23:40 +0200)]
Support TGA reading

We add PHP bindings for libgd's features to read TGA files, which are
available as of libgd 2.1.0.

As PHP's bundled libgd doesn't yet include the respective features of the
external libgd, we add these.

Since TGA has no easily recognizable file signature, we don't add TGA
support for imagecreatefromstring() or getimagesize() and friends.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 20 Jun 2019 16:01:02 +0000 (18:01 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78189: file cache strips last character of uname hash

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Thu, 20 Jun 2019 15:59:07 +0000 (17:59 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #78189: file cache strips last character of uname hash

5 years agoFix #78189: file cache strips last character of uname hash
Christoph M. Becker [Thu, 20 Jun 2019 15:53:10 +0000 (17:53 +0200)]
Fix #78189: file cache strips last character of uname hash

We must not forget to increase `len` by one to cater to the directory
separator.

5 years agoRemove leftover check
Nikita Popov [Thu, 20 Jun 2019 14:46:26 +0000 (16:46 +0200)]
Remove leftover check

This is checked below now in a way that handles misaligned pointers.

5 years agoHandle misaligned ifreq on macos
Nikita Popov [Thu, 20 Jun 2019 14:13:16 +0000 (16:13 +0200)]
Handle misaligned ifreq on macos

5 years agoHandle gr_mem misalignment on macos
Nikita Popov [Thu, 20 Jun 2019 14:06:54 +0000 (16:06 +0200)]
Handle gr_mem misalignment on macos

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 20 Jun 2019 15:00:33 +0000 (17:00 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Update NEWS

5 years agoUpdate NEWS
Christoph M. Becker [Thu, 20 Jun 2019 14:59:39 +0000 (16:59 +0200)]
Update NEWS

5 years agoRename test file to reflect the appropriate ticket number
Christoph M. Becker [Thu, 20 Jun 2019 14:54:17 +0000 (16:54 +0200)]
Rename test file to reflect the appropriate ticket number

5 years agoCheck for dlsym as well
Nikita Popov [Thu, 20 Jun 2019 13:48:48 +0000 (15:48 +0200)]
Check for dlsym as well

For some reason, when using GCC with address sanitizer, dlopen
is available without -ldl, but dlsym still needs it. Explicitly check
dlsym so we add the library.

5 years agoHandle gethostbyname misalignment on macos
Nikita Popov [Thu, 20 Jun 2019 12:14:46 +0000 (14:14 +0200)]
Handle gethostbyname misalignment on macos

5 years agoSOAP: Avoid indexing into null pointer
Nikita Popov [Thu, 20 Jun 2019 13:03:44 +0000 (15:03 +0200)]
SOAP: Avoid indexing into null pointer

5 years agoFFI: Use signed arithmetic for pointer offset
Nikita Popov [Thu, 20 Jun 2019 12:52:12 +0000 (14:52 +0200)]
FFI: Use signed arithmetic for pointer offset

offset can be negative here, using signed arithmetic avoids ubsan
warnings.

5 years agoIn php_needle_char() use well-defined double->integer cast
Nikita Popov [Thu, 20 Jun 2019 12:09:18 +0000 (14:09 +0200)]
In php_needle_char() use well-defined double->integer cast

...by going through zval_get_long(). Generally out of range double
casts are undefined.

5 years agoAvoid address calculation overflow
Nikita Popov [Thu, 20 Jun 2019 11:06:56 +0000 (13:06 +0200)]
Avoid address calculation overflow

5 years agoBail out earlier in zend_memnrstr
Nikita Popov [Thu, 20 Jun 2019 10:18:54 +0000 (12:18 +0200)]
Bail out earlier in zend_memnrstr

To avoid decrementing a null pointer lateron. As we need to check
for NULL here anayway, we should take the chance to bail out right
away.

5 years agoDisable float division by zero sanitizer for div_function
Nikita Popov [Thu, 20 Jun 2019 10:11:30 +0000 (12:11 +0200)]
Disable float division by zero sanitizer for div_function

We intentionally divide by zero here and want to get IEEE-754
semantics.

5 years agoChange indexing scheme for symtable_cache
Nikita Popov [Thu, 20 Jun 2019 08:52:18 +0000 (10:52 +0200)]
Change indexing scheme for symtable_cache

symtable_cache_ptr now points to the first unused symtable_cache
entry, rahter than the last used one. This avoids taking a pointer
to the minus first element of the array, which is UB. Instead we
take a pointer to the end plus one, which is not UB.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Thu, 20 Jun 2019 09:59:04 +0000 (11:59 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  fix test for Windows and for parallel run

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Thu, 20 Jun 2019 09:58:49 +0000 (11:58 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  fix test for Windows and for parallel run

5 years agofix test for Windows and for parallel run
Remi Collet [Thu, 20 Jun 2019 09:58:32 +0000 (11:58 +0200)]
fix test for Windows and for parallel run

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Thu, 20 Jun 2019 09:52:25 +0000 (11:52 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  improve test clean section
  move NEWS entry

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Thu, 20 Jun 2019 09:51:51 +0000 (11:51 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  improve test clean section

5 years agoimprove test clean section
Remi Collet [Thu, 20 Jun 2019 09:51:18 +0000 (11:51 +0200)]
improve test clean section

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Thu, 20 Jun 2019 08:41:21 +0000 (10:41 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  move NEWS entry

5 years agomove NEWS entry
Remi Collet [Thu, 20 Jun 2019 08:40:52 +0000 (10:40 +0200)]
move NEWS entry

5 years agoFix maybe uninit warning
Nikita Popov [Thu, 20 Jun 2019 08:35:22 +0000 (10:35 +0200)]
Fix maybe uninit warning

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Thu, 20 Jun 2019 08:28:26 +0000 (10:28 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  add test for #78185

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Thu, 20 Jun 2019 08:28:00 +0000 (10:28 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  add test for #78185

5 years agoadd test for #78185
Remi Collet [Thu, 20 Jun 2019 08:27:33 +0000 (10:27 +0200)]
add test for #78185

5 years agoimagecolorallocate(): Check that RGB components are in-range
Nikita Popov [Thu, 20 Jun 2019 08:09:54 +0000 (10:09 +0200)]
imagecolorallocate(): Check that RGB components are in-range

Instead of letting them bleed over into other components.

5 years agoAvoid overflow in mul range calculation
Nikita Popov [Thu, 20 Jun 2019 07:57:55 +0000 (09:57 +0200)]
Avoid overflow in mul range calculation

By using ZEND_SIGNED_MULTIPLY_LONG, which already implemented
efficient overflow checking logic.

5 years agoBackport "Avoid UB in overflow checks"
Nikita Popov [Wed, 19 Jun 2019 09:58:42 +0000 (11:58 +0200)]
Backport "Avoid UB in overflow checks"

Cherry-pick of bb940d9969e08853d92a09f7a02adc3228cf1c2c without
the JIT parts.

5 years agoAvoid memset/memcpy null ub in block pass
Nikita Popov [Thu, 20 Jun 2019 07:49:07 +0000 (09:49 +0200)]
Avoid memset/memcpy null ub in block pass

The arena allocator has no problem with zero-size allocations (and
will just return the same pointer for each in this case), so just
do that to avoid null pointers.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Dmitry Stogov [Thu, 20 Jun 2019 06:07:39 +0000 (09:07 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78185 (File cache no longer works)

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Dmitry Stogov [Thu, 20 Jun 2019 06:05:50 +0000 (09:05 +0300)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fixed bug #78185 (File cache no longer works)

5 years agoFixed bug #78185 (File cache no longer works)
Dmitry Stogov [Thu, 20 Jun 2019 06:04:14 +0000 (09:04 +0300)]
Fixed bug #78185 (File cache no longer works)

5 years agoAvoid signed shift ub in php_sdl
Nikita Popov [Wed, 19 Jun 2019 15:25:20 +0000 (17:25 +0200)]
Avoid signed shift ub in php_sdl

5 years agoFix various instances of memcpy null ub
Nikita Popov [Wed, 19 Jun 2019 14:53:42 +0000 (16:53 +0200)]
Fix various instances of memcpy null ub

5 years agoRemove copy argument from php_glob_stream_get_path/pattern
Nikita Popov [Wed, 19 Jun 2019 15:02:54 +0000 (17:02 +0200)]
Remove copy argument from php_glob_stream_get_path/pattern

This is unused, and shouldn't be part of the API.

5 years agoSuppress shift UB in gd_itofx()
Nikita Popov [Wed, 19 Jun 2019 14:42:17 +0000 (16:42 +0200)]
Suppress shift UB in gd_itofx()

There doesn't seem to be a corresponding upstream fix for this.

5 years agoMerge branch 'PHP-7.4' of https://git.php.net/push/php-src into PHP-7.4
Andrey Hristov [Wed, 19 Jun 2019 15:17:35 +0000 (18:17 +0300)]
Merge branch 'PHP-7.4' of https://git.php.net/push/php-src into PHP-7.4

5 years agoFixed bug #78182
Nikita Popov [Wed, 19 Jun 2019 14:35:12 +0000 (16:35 +0200)]
Fixed bug #78182

5 years agoSuppress overflow UB in zend_strtod
Nikita Popov [Wed, 19 Jun 2019 13:57:57 +0000 (15:57 +0200)]
Suppress overflow UB in zend_strtod

5 years agoFix shift UB in hash_snefru
Nikita Popov [Wed, 19 Jun 2019 13:55:56 +0000 (15:55 +0200)]
Fix shift UB in hash_snefru

5 years agoimageloadfont: Perform overflow check before calculation
Nikita Popov [Wed, 19 Jun 2019 13:50:52 +0000 (15:50 +0200)]
imageloadfont: Perform overflow check before calculation

Instead of afterwards...

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Andrey Hristov [Wed, 19 Jun 2019 13:43:15 +0000 (16:43 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Andrey Hristov [Wed, 19 Jun 2019 13:43:06 +0000 (16:43 +0300)]
Merge branch 'PHP-7.2' into PHP-7.3

5 years agoFix version comparison
Andrey Hristov [Wed, 19 Jun 2019 13:42:43 +0000 (16:42 +0300)]
Fix version comparison

5 years agoFix buffer underflow in gd_gif_in.c
Nikita Popov [Wed, 19 Jun 2019 13:41:45 +0000 (15:41 +0200)]
Fix buffer underflow in gd_gif_in.c

This has been fixed upstream in
https://github.com/libgd/libgd/commit/939d49a3a9d1cbcd2a37cea9eac9f9e5e9f9de78.

5 years agoFix uninitialized variable
Nikita Popov [Wed, 19 Jun 2019 13:34:51 +0000 (15:34 +0200)]
Fix uninitialized variable

I mistakenly moved len1 initialization into the conditional as well.

5 years agoFix shift UB in gd_io.c
Nikita Popov [Wed, 19 Jun 2019 13:06:48 +0000 (15:06 +0200)]
Fix shift UB in gd_io.c

This has already been fixed upstream in
https://github.com/libgd/libgd/commit/24d352576c024769d18113a28f3be03d54fa1e66
and
https://github.com/libgd/libgd/commit/772d0107a6b00a0d6d7191383fe984f8c018b48c.

5 years agoFix shift UB in php_ifd_get32s
Nikita Popov [Wed, 19 Jun 2019 13:03:22 +0000 (15:03 +0200)]
Fix shift UB in php_ifd_get32s

5 years agoPhar: Avoid negative zip dates
Nikita Popov [Wed, 19 Jun 2019 12:56:11 +0000 (14:56 +0200)]
Phar: Avoid negative zip dates

The zip date/time encoding format is incredibly stupid.

5 years agoFix memcpy null UB in phar
Nikita Popov [Wed, 19 Jun 2019 12:38:29 +0000 (14:38 +0200)]
Fix memcpy null UB in phar

5 years agoFix shift UB in mbfilter_utf32.c
Nikita Popov [Wed, 19 Jun 2019 12:35:44 +0000 (14:35 +0200)]
Fix shift UB in mbfilter_utf32.c

5 years agoFix shift UB in sint4korr()
Nikita Popov [Wed, 19 Jun 2019 12:27:13 +0000 (14:27 +0200)]
Fix shift UB in sint4korr()

5 years agoFix incorrect shift in mysqlnd_wireprotocol
Nikita Popov [Wed, 19 Jun 2019 12:22:05 +0000 (14:22 +0200)]
Fix incorrect shift in mysqlnd_wireprotocol

This one looks like a genuine bug: We're shifting a uint16_t by
16 bits. On x86 that likely results in no shift happening.

5 years agoFix overflow UB in range()
Nikita Popov [Wed, 19 Jun 2019 12:12:54 +0000 (14:12 +0200)]
Fix overflow UB in range()

5 years agoAvoid memcpy UB in streams
Nikita Popov [Wed, 19 Jun 2019 12:04:54 +0000 (14:04 +0200)]
Avoid memcpy UB in streams

5 years agoAvoid more UB in round()
Nikita Popov [Wed, 19 Jun 2019 12:03:34 +0000 (14:03 +0200)]
Avoid more UB in round()

5 years agoUse unsigned char in _crypt_extended_r
Nikita Popov [Wed, 19 Jun 2019 11:48:20 +0000 (13:48 +0200)]
Use unsigned char in _crypt_extended_r

Avoid signed shift UB.

5 years agoUse unsigned chars in php_uuencode()
Nikita Popov [Wed, 19 Jun 2019 11:23:02 +0000 (13:23 +0200)]
Use unsigned chars in php_uuencode()

Avoid shift UB on signed integers.

5 years agoFix _php_math_round UB
Nikita Popov [Wed, 19 Jun 2019 11:18:23 +0000 (13:18 +0200)]
Fix _php_math_round UB

php_intlog10abs() is ill-defined for a zero value. Avoid calling it
altogether as there's nothing to round with a zero value.

5 years agoFix memcpy null arg UB
Nikita Popov [Wed, 19 Jun 2019 11:11:07 +0000 (13:11 +0200)]
Fix memcpy null arg UB

5 years agoFix signed shift UB
Nikita Popov [Wed, 19 Jun 2019 10:59:18 +0000 (12:59 +0200)]
Fix signed shift UB

5 years agoAvoid overflow UB in is_numeric_string
Nikita Popov [Wed, 19 Jun 2019 10:53:10 +0000 (12:53 +0200)]
Avoid overflow UB in is_numeric_string

We intentionally overflow the signed space here, so make this an
unsigned variable and only cast to signed at the end.

5 years agoFix shift UB in constants
Nikita Popov [Wed, 19 Jun 2019 10:47:56 +0000 (12:47 +0200)]
Fix shift UB in constants

We were shifting out the top bit of a signed integer.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Joe Watkins [Wed, 19 Jun 2019 10:43:17 +0000 (12:43 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  fix setcookie Max-Age to use php_time

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Joe Watkins [Wed, 19 Jun 2019 10:42:25 +0000 (12:42 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  fix setcookie Max-Age to use php_time