1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Commit Graph

132125 Commits

Author SHA1 Message Date
nielsdos
2fa8473eca Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10834: exif_read_data() cannot read smaller stream wrapper chunk sizes
2023-05-12 23:42:54 +02:00
nielsdos
d369a7764f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10834: exif_read_data() cannot read smaller stream wrapper chunk sizes
2023-05-12 23:40:54 +02:00
Niels Dossche
7b768485f3 Fix GH-10834: exif_read_data() cannot read smaller stream wrapper chunk sizes
php_stream_read() may return less than the requested amount of bytes by
design. This patch introduces a static function for exif which reads
from the stream in a loop until all the requested bytes are read.

For the test: Co-authored-by: dotpointer

Closes GH-10924.
2023-05-12 23:37:00 +02:00
Ilija Tovilo
e0af7c332d Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix delayed early binding class redeclaration error
2023-05-12 19:29:27 +02:00
Ilija Tovilo
e3499130f1 Fix delayed early binding class redeclaration error
If we bind the class to the runtime slot even if we're not the ones who have
performed early binding we'll miss the redeclaration error in the
ZEND_DECLARE_CLASS_DELAYED handler.

Closes GH-11226
2023-05-12 19:29:04 +02:00
iamluc
730f32bad9 Keep the orig_path for xport stream
Closes GH-11113
2023-05-12 15:33:55 +01:00
Ilija Tovilo
8d8cfe24d3 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix potential NULL pointer access in zend_fiber_object_gc
2023-05-11 14:35:42 +02:00
Ilija Tovilo
0a04c008d0 Fix potential NULL pointer access in zend_fiber_object_gc
Accidentally introduced in GH-11208.

Fixes oss-fuzz #58795
2023-05-11 14:33:49 +02:00
Ilija Tovilo
c71cf0608f Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Add missing --no-progress flag to ARM build
2023-05-11 12:47:42 +02:00
Ilija Tovilo
12c30a8da3 [skip ci] Add missing --no-progress flag to ARM build 2023-05-11 12:47:25 +02:00
Ilija Tovilo
6a2d04151a Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Remove NEWS entry for reverted change in PHP 8.1
2023-05-11 11:54:07 +02:00
Ilija Tovilo
c47c64e398 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Remove NEWS entry for reverted change in PHP 8.1
2023-05-11 11:53:59 +02:00
Ilija Tovilo
ad747d93c3 [skip ci] Remove NEWS entry for reverted change in PHP 8.1 2023-05-11 11:53:18 +02:00
Ilija Tovilo
5820528c9c Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix compilation for PHP 8.1
2023-05-11 00:00:47 +02:00
Ilija Tovilo
5e962f6279 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix compilation for PHP 8.1
2023-05-11 00:00:35 +02:00
Ilija Tovilo
8f66b67ccf Fix compilation for PHP 8.1
Accidentally introduced in 175ff603c3. arData was
not part of an anonymous union.
2023-05-10 23:59:53 +02:00
kocsismate
09dd3e3daf Narrow some more return types to true 2023-05-10 19:08:15 +02:00
Bob Weinand
0787247b19 Merge branch 'PHP-8.2' 2023-05-10 16:46:33 +02:00
Bob Weinand
53558ffc71 Merge branch 'PHP-8.1' into PHP-8.2 2023-05-10 16:45:48 +02:00
Bob Weinand
975d28e278 Fix GH-11222: foreach by-ref may jump over keys during a rehash
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-05-10 16:45:05 +02:00
Ilija Tovilo
7304b56f11 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix compilation error on old GCC versions
2023-05-10 11:57:19 +02:00
Ilija Tovilo
6692477406 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix compilation error on old GCC versions
2023-05-10 11:56:07 +02:00
Amedeo Baragiola
175ff603c3 Fix compilation error on old GCC versions
In older versions of GCC (<=4.5) designated initializers would not accept member
names nested inside anonymous structures. Instead, we need to use a positional
member wrapped in {}.

Fixes GH-11063
Closes GH-11212
2023-05-10 11:55:13 +02:00
nielsdos
63a84a2445 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-8426: make test fail while soap extension build
2023-05-09 19:57:02 +02:00
nielsdos
44491d17fb Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-8426: make test fail while soap extension build
2023-05-09 19:52:52 +02:00
nielsdos
6ba0b06819 Fix GH-8426: make test fail while soap extension build
If you build soap as a shared object, then these tests fail on
non-Windows, or when the PHP install hasn't been make install-ed yet,
but is executed from the development directory.

Closes GH-11211.
2023-05-09 19:48:45 +02:00
Niels Dossche
acc940645e Remove unnecessary NULL assignments after ecalloc in streams (#11209)
ecalloc already zeroes the structure, so writing NULL is not necessary.
2023-05-09 19:46:45 +02:00
Ilija Tovilo
173680acd3 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix use-of-undefined in zend_fiber_object_gc of ex->call
2023-05-09 14:38:25 +02:00
Ilija Tovilo
06fe9ff0f1 Fix use-of-undefined in zend_fiber_object_gc of ex->call
ex->call is only set for user calls, we shouldn't access it here.
zend_unfinished_execution_gc_ex wouldn't actually use it for internal calls, so
it didn't cause any serious issues.

Closes GH-11208
2023-05-09 14:37:47 +02:00
Ilija Tovilo
38cf52d8aa Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix use-of-uninitialized value in phar_object.c
2023-05-08 17:07:04 +02:00
Ilija Tovilo
b71a961363 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix use-of-uninitialized value in phar_object.c
2023-05-08 17:06:57 +02:00
Ilija Tovilo
78ec64af44 Fix use-of-uninitialized value in phar_object.c
resource would stay uninitialized if the first call to zend_parse_parameters
fails, but the value is still passed to phar_add_file(). It's not used there if
cont_str is provided and so didn't cause any issues.

Closes GH-11202
2023-05-08 17:06:44 +02:00
Michael Voříšek
37e6594545 Fix gmp_long/gmp_ulong typedef warning on Windows x86 (#11112) 2023-05-07 23:30:12 +02:00
Máté Kocsis
281669aeb4 Add support for true standalone type when generating methodsynopsis 2023-05-07 19:34:09 +02:00
Máté Kocsis
85338569de Narrow bool return types to true when possible 2023-05-07 19:34:09 +02:00
Niels Dossche
f6e296dbb9 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-11180: hash_file() appears to be restricted to 3 arguments
2023-05-07 17:40:29 +02:00
Niels Dossche
e6730565b6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11180: hash_file() appears to be restricted to 3 arguments
2023-05-07 17:37:25 +02:00
Niels Dossche
baa07f3de3 Fix GH-11180: hash_file() appears to be restricted to 3 arguments
Closes GH-11198.
2023-05-07 17:33:28 +02:00
George Peter Banyard
646f54b594 ext/standard/array.c: use uint32_t instead of incorrect int type
Drive-by indentation fixes and bool usage
2023-05-07 15:01:37 +01:00
George Peter Banyard
1820c421f1 Prevent unnecessary string duplication in assert() (#11031) 2023-05-07 15:00:30 +01:00
Ilija Tovilo
5107483cd6 Correctly copy lineno for zval asts (#11203)
The comment was incorrect. Zval ASTs store their lineno in u2, but u2 does not
get copied in ZVAL_COPY. This triggers use-of-uninitialized errors with MSAN.
Unfortunately, I don't have a simple reproducer.
2023-05-07 13:17:19 +02:00
Niels Dossche
82b05373b1 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-11160: Few tests failed building with new libxml 2.11.0
2023-05-06 23:15:57 +02:00
Niels Dossche
dc1a70c244 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11160: Few tests failed building with new libxml 2.11.0
2023-05-06 23:10:58 +02:00
Niels Dossche
7c0dfc5cf5 Fix GH-11160: Few tests failed building with new libxml 2.11.0
It's possible to categorise the failures into 2 categories:
  - Changed error message. In this case we either duplicate the test and
    modify the error message. Or if the change in error message is
    small, we use the EXPECTF matchers to make the test compatible with both
    old and new versions of libxml2.
  - Missing warnings. This is caused by a change in libxml2 where the
    parser started using SAX APIs internally [1]. In this case the
    error_type passed to php_libxml_internal_error_handler() changed from
    PHP_LIBXML_ERROR to PHP_LIBXML_CTX_WARNING because it internally
    started to use the SAX handlers instead of the generic handlers.
    However, for the SAX handlers the current input stack is empty, so
    nothing is actually printed. I fixed this by falling back to a
    regular warning without a filename & line number reference, which
    mimicks the old behaviour. Furthermore, this change now also shows
    an additional warning in a test which was previously hidden.

[1] 9a82b94a94

Closes GH-11162.
2023-05-06 23:10:07 +02:00
Niels Dossche
80efa76b8b Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix maximum argument count of pcntl_forkx()
2023-05-06 21:00:30 +02:00
Niels Dossche
a0e71cb811 Fix maximum argument count of pcntl_forkx()
Closes GH-11199.
2023-05-06 20:56:27 +02:00
Florian Moser
4d4b9604ca Fix GH-11054: Reset OpenSSL errors when using a PEM public key
The error happens when the PEM contains a public key, as it will be
first tried to be parsed as a certificate. The parsing as a certificate
fails, which then leads to a corresponding error tracked by PHP with
the next call to php_openssl_store_errors().

This change introduces an error marking to be able to reset the stored
errors to the state before trying the certificate.

Closes GH-11055
2023-05-06 11:56:31 +01:00
Jakub Zelenka
5690e8baea Add myself as a standard CODEOWNER to not miss some changes
I have got some knowledge of some pieces there so happy to do reviews.
2023-05-06 11:39:48 +01:00
Daniel Kesselberg
fa10dfcc81 Add PKCS7_NOOLDMIMETYPE and OPENSSL_CMS_OLDMIMETYPE
PKCS7_NOOLDMIMETYPE to use Content-Type application/pkcs7-mime
OPENSSL_CMS_OLDMIMETYPE to use Content-Type application/x-pkcs7-mime

SMIME_write_PKCS7 and SMIME_write_CMS are using SMIME_write_ASN1_ex.
The Content-Type application/x-pkcs7-mime is generated with the flag SMIME_OLDMIME (0x400).[^1]

SMIME_write_PKCS7 set SMIME_OLDMIME by default.[^2]
SMIME_write_CMS does not.[^3]

I picked OPENSSL_CMS_OLDMIMETYPE over OPENSSL_CMS_NOOLDMIMETYPE because that's what the flag actually does.

[^1]: 9a2f78e14a/crypto/asn1/asn_mime.c (L248-L251)
[^2]: 9a2f78e14a/crypto/pkcs7/pk7_mime.c (L41-L43)
[^3]: 9a2f78e14a/crypto/cms/cms_io.c (L93)

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-05-06 11:12:31 +01:00
David CARLIER
f18a0384c1 ext/pgsql: fix pg_trace test when trace mode is supported. (#11191) 2023-05-06 10:02:30 +01:00