-
Notifications
You must be signed in to change notification settings - Fork 7.9k
UB when freeing a cloned _ZendTestFiber #16388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Unless there is the need to clone instances of _ZendTestFiber, we can just disallow this: ext/zend_test/fiber.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ext/zend_test/fiber.c b/ext/zend_test/fiber.c
index 30dbfa06e5..fa285aa2d6 100644
--- a/ext/zend_test/fiber.c
+++ b/ext/zend_test/fiber.c
@@ -352,4 +352,5 @@ void zend_test_fiber_init(void)
zend_test_fiber_handlers = std_object_handlers;
zend_test_fiber_handlers.dtor_obj = zend_test_fiber_object_destroy;
zend_test_fiber_handlers.free_obj = zend_test_fiber_object_free;
+ zend_test_fiber_handlers.clone_obj = NULL;
} |
cmb69
added a commit
to cmb69/php-src
that referenced
this issue
Oct 12, 2024
Since there is no need to clone instances of this test class, we prevent cloning in the first place.
cmb69
added a commit
that referenced
this issue
Oct 12, 2024
* PHP-8.2: Fix GH-16388: UB when freeing a cloned _ZendTestFiber
cmb69
added a commit
that referenced
this issue
Oct 12, 2024
* PHP-8.3: Fix GH-16388: UB when freeing a cloned _ZendTestFiber
cmb69
added a commit
that referenced
this issue
Oct 12, 2024
* PHP-8.4: Fix GH-16388: UB when freeing a cloned _ZendTestFiber
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The following code:
Resulted in this output:
To reproduce:
There are some similar issues, not sure if it is a dup.
PHP Version
nightly
Operating System
ubuntu 22.04
The text was updated successfully, but these errors were encountered: