Commit graph

135599 commits

Author SHA1 Message Date
Niels Dossche
81d9a27c47
Fix some leaks in php_scandir
Closes GH-18371.
2025-04-21 13:20:45 +02:00
Niels Dossche
bf4b470098
Fix reference support for intltz_get_offset()
It should use the helper macros such that types are properly respected.

Closes GH-18364.
2025-04-20 14:23:31 +02:00
Niels Dossche
c905d59106
Fix NULL deref on high modification key
We should re-index in the loop.

Closes GH-18331.
2025-04-16 11:37:49 +02:00
Niels Dossche
91c6c727d5
Fix memory leak when handling a too long path in ZipArchive::addGlob()
Closes GH-18330.
2025-04-16 10:45:35 +02:00
Niels Dossche
0a6326c6ac
Fix uouv when handling empty options in ZipArchive::addGlob()
Reported by OpenAI AARDVARK.

php_zip_parse_option is only called when options are passed to the function.
Prior to this patch, php_zip_parse_option was responsible for zeroing the
opts variable. So in the case when php_zip_parse_option is not called,
opts remains uninitialized yet it is being used anyway.
By just always zeroing opts at declaration time, we avoid this issue
and we are unlikely to reintroduce this in the future.

Closes GH-18329.
2025-04-16 10:44:59 +02:00
Saki Takamachi
9d4f8b5379
Fixed GH-18276 - persistent connection - "zend_mm_heap corrupted" with setAttribute() (#18280)
Closes #18280
Fixes #18276
2025-04-15 09:01:40 +09:00
haszi
701f3a1af6
Mark ob_start callback parameter nullable 2025-04-14 22:35:06 +02:00
Niels Dossche
67503870ca
Fix GH-18322: SplObjectStorage debug handler mismanages memory
This hack was once necessary before there was a proper get_gc handler,
but now it breaks the engine constraints.

Closes GH-18323.
2025-04-14 14:11:09 +02:00
Niels Dossche
8849a5336e
Fix GH-18309: ipv6 filter integer overflow
The intermediate computation can cause a signed integer overflow, but
the input is correctly rejected later on by the check on variable `n`.
Solve this by using an unsigned number.

Closes GH-18312.
2025-04-11 23:35:00 +02:00
Niels Dossche
ba0853888d
Fix GH-18304: Changing the properties of a DateInterval through dynamic properties triggers a SegFault
For dynamic fetches the cache_slot will be NULL, so we have to check for
that when resetting the cache. For zip and xmlreader this couldn't
easily be tested because of a lack of writable properties.

Closes GH-18307.
2025-04-11 23:33:58 +02:00
Niels Dossche
29f96fb1f1
Fix potential leaks when writing to BIO fails
When the BIO is created but writing fails, these can leak.

Closes GH-18186.
2025-04-11 21:02:37 +02:00
Remi Collet
90f582b188
[ci skip] fix news 2025-04-10 17:21:15 +02:00
Remi Collet
98fb27a577
NEWS for GH-17940 2025-04-10 17:09:03 +02:00
Remi Collet
389de7c6bf
Fix #17776 LDAP_OPT_X_TLS_REQUIRE_CERT can't be overridden 2025-04-10 17:07:15 +02:00
Gina Peter Banyard
61f704f269
ext/libxml: Fixed custom external entity loader returning an invalid resource leading to a confusing TypeError message
Closes GH-18096
2025-04-07 12:58:52 +01:00
David Carlier
fe8dffef5d
Fixed GH-18243: imagettftext underflow/overflow on size argument.
close GH-18245
2025-04-05 15:56:45 +01:00
Ilija Tovilo
821e3460fb
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Restrict on-push freebsd build to main repo
2025-04-03 13:03:06 +02:00
Ilija Tovilo
8b27c14aa9
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Restrict on-push freebsd build to main repo
2025-04-03 13:02:51 +02:00
Ilija Tovilo
7a3383b482
[skip ci] Restrict on-push freebsd build to main repo
The same applies to all other push jobs, it was just forgotten here.
2025-04-03 13:01:59 +02:00
Niels Dossche
8a1f6711bf
Fix resource leak in iptcembed() on error
Closes GH-18225.
2025-04-02 21:05:48 +02:00
Niels Dossche
5e68671f88
Fix inverted call to php_openssl_store_errors()
This calls php_openssl_store_errors() in the success path right now,
change it to call php_openssl_store_errors() in the error path.
2025-04-02 20:25:21 +02:00
Niels Dossche
0dc600c69a
Fix openssl_random_pseudo_bytes() always setting strong_result to true
This regressed in 62c7432f, prior to that commit the value was set to
false in case random number generation failed, but now even if an
exception is thrown it is set to true. This likely does not _really_
matter as the user will handle the exception, still the value in
$strong_result is observable.
2025-04-02 20:25:21 +02:00
Niels Dossche
74720a22f3
Fix memory leak in openssl_sign() when passing invalid algorithm
Closes GH-18185.
2025-04-02 20:15:53 +02:00
David Carlier
2e47442a6b
Fix GH-18212: fseek with SEEK_CUR and negative offset crash on debug
Triggers the assertion as with SEEK_CUR the stream position is set to a
negative value so we force the failure without affecting its position
instead.

close GH-18224
2025-04-02 12:34:50 +01:00
Ilija Tovilo
a21065e6eb
Use-after-free in extract() with EXTR_REFS
Fixes GH-18209
Closes GH-18211
2025-04-01 16:33:30 +02:00
Niels Dossche
13d51f895b
Add missing EXTENSIONS section to intl test
[ci skip]
2025-03-31 23:05:15 +02:00
Ilija Tovilo
c0b441f8fd
[skip ci] Fix valgrind benchmark diff output
Don't print command when searching benchmarked commit, as this breaks
the markdown summary.
2025-03-30 00:42:59 +01:00
David Carlier
a1620048fb
ext/gd: imagecrop rect argument overflow fixes.
```
ext/gd/libgd/gd.c:2275:14: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
    #0 0x5d6a2103e1db in php_gd_gdImageCopy /home/dcarlier/Contribs/php-src/ext/gd/libgd/gd.c:2275
    #1 0x5d6a210a2b63 in gdImageCrop /home/dcarlier/Contribs/php-src/ext/gd/libgd/gd_crop.c:57
    #2 0x5d6a21018ca4 in zif_imagecrop /home/dcarlier/Contribs/php-src/ext/gd/gd.c:3575
    #3 0x5d6a21e46e7a in ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:1337
    #4 0x5d6a221188da in execute_ex /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:57246
    #5 0x5d6a221366bd in zend_execute /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:61634
    #6 0x5d6a21d107a6 in zend_execute_scripts /home/dcarlier/Contribs/php-src/Zend/zend.c:1895
    #7 0x5d6a21a63409 in php_execute_script /home/dcarlier/Contribs/php-src/main/main.c:2529
    #8 0x5d6a22516d5e in do_cli /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:966
    #9 0x5d6a2251981d in main /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:1341
    #10 0x7f10d002a3b7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #11 0x7f10d002a47a in __libc_start_main_impl ../csu/libc-start.c:360
    #12 0x5d6a20a06da4 in _start (/home/dcarlier/Contribs/php-src/sapi/cli/php+0x2806da4) (BuildId: d9a79c7e0e4872311439d7313cb3a81fe04190a2)
```

close GH-18006
2025-03-28 17:30:25 +00:00
Jakub Zelenka
fe4930612a
[ci skip] Fix NEWS 2025-03-27 11:53:24 +01:00
Jakub Zelenka
2197a490f7
Fix GH-18145: basic_globals_ctor initialization
This resets all basic globals during ctor and just modifies the ones
with a special value. It also switches to using basic_globals_p which
what should be used in this context.

Closes GH-18156
2025-03-27 11:35:55 +01:00
Ilija Tovilo
f994c2f1fa
Implement benchmark diff commit fallback
When the base commit is not benchmarked (yet), iterate first parents of
the commit until we find one that is.

Fixes GH-18094
Closes GH-18152
2025-03-26 23:34:47 +01:00
Jakub Zelenka
b57f425cfe
PHP 8.3 is now for PHP 8.3.21-dev 2025-03-25 22:09:16 +01:00
DanielEScherzer
c45d608569
Add myself as ext/reflection codeowner [skip ci] 2025-03-25 11:20:12 -07:00
Ilija Tovilo
37e75a1c5f
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Backport intl test changes for ICU 77
2025-03-24 15:07:43 +01:00
Ilija Tovilo
d4c548cf42
Backport intl test changes for ICU 77
See GH-18125
See 8823f89a32
2025-03-24 15:07:14 +01:00
Derick Rethans
0c8a7a77a8
Updated to version 2025.2 (2025b) 2025-03-24 10:06:32 +00:00
Niels Dossche
071f707a6d
[ci skip] Make sure opcache can output in these tests 2025-03-21 16:35:47 +01:00
Niels Dossche
8823f89a32
Fix intl tests for icu 77 (#18125) 2025-03-21 14:23:03 +01:00
Niels Dossche
2ec8d37eb4
Fix GH-18107: Opcache CFG jmp optimization with try-finally breaks the exception table
If there's a try-finally where the try_op starts on a basic block with a
single JMP, and the JMP optimization causes that basic block to become
unreachable, then we update try_op.
In this case, there is no catch_op, so try_op is erroneously set to 0,
we should instead set it to `b->start`.

Closes GH-18110.
2025-03-21 13:56:31 +01:00
Daniel Scherzer
fa3c1c81d5
Fix GH-17836: zend_vm_gen.php shouldn't break on Windows line endings
Closes GH-18121.
2025-03-21 11:50:34 +01:00
Niels Dossche
447d143b9d
Fixed bug GH-13193 again
Closes GH-13193.
2025-03-21 11:47:52 +01:00
Remi Collet
7e6a36889c
NEWS for #66049 2025-03-21 08:25:05 +01:00
Remi Collet
209f4c296e
Fix #66049 Typemap can break parsing in parse_packet_soap leading to a segfault 2025-03-21 08:23:12 +01:00
Niels Dossche
2dde07af55
Fix memory leak when destroying PDORow
This should call zend_object_std_dtor() to clean the property table etc.
This also has a semantic influence because previously weak refs were not
notified for example.

This fixes the final issue in GH-18114 (the crash was master-only and
fixed already).

Closes GH-18114.
Closes GH-18123.
2025-03-20 23:13:42 +01:00
Niels Dossche
6af240d8da
[ci skip] Fix NEWS order 2025-03-20 19:14:09 +01:00
Niels Dossche
e9c0296240
Fix GH-18112: NULL access with preloading and INI option
Preloading shutdown calls request shutdown which will deactivate the
virtual cwd state. However, further startup code still assumes the state
that was set by virtual_cwd_startup(). So we need to reactivate it
manually.

Creating a test was a bit difficult because the INI setting I wanted to
test this with is overridden by the test runner apparently.
To reproduce the issue, create an empty file test.php and execute this
in a ZTS build:
`php -d opcache.preload=./ext/opcache/tests/preload_class_alias_2.inc -d "error_log=" -d "allow_url_include=1" test.php`

Closes GH-18117.
2025-03-20 19:12:06 +01:00
Niels Dossche
d9329b1522
Fix xinclude destruction of live attributes
Follow-up for GH-17847 but now for attributes.

Closes GH-18100.
2025-03-18 22:01:56 +01:00
Arnaud Le Blanc
c531f3d79b
Disable ZEND_RC_MOD_CHECK() while loading shared extension in FPM
This fixes a ZEND_RC_MOD_CHECK() assertion failure when building with
"-DZEND_RC_DEBUG=1 --enable-debug --enable-zts". php_dl() is called after
startup, and manipulates the refcount of persistent strings, which is not
allowed at this point of the lifecycle.

The dl() function disables the ZEND_RC_MOD_CHECK() assertion before calling
php_dl(). This change applies the same workaround in FPM.

Closes GH-18075
2025-03-17 17:40:05 +01:00
Jakub Zelenka
bd7d3c38ad
Get rid of atime change testing in bug72666_variation3.phpt 2025-03-17 14:49:22 +01:00
Katherine456719
38e553e418
Fix GH-18082: Memory leaks in fuzzer SAPI error paths
Closes GH-18081.
2025-03-16 16:37:59 +01:00