Skip to content
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

Segfault in hash_copy() on a finalized context #12186

Closed
MaxSem opened this issue Sep 12, 2023 · 0 comments
Closed

Segfault in hash_copy() on a finalized context #12186

MaxSem opened this issue Sep 12, 2023 · 0 comments

Comments

@MaxSem
Copy link
Contributor

MaxSem commented Sep 12, 2023

Description

The following code:

https://3v4l.org/AdgqN

<?php
$c = hash_init('sha1');
hash_final($c);
hash_copy($c);

Resulted in this output:

Segmentation fault

Same thing happens when the context is cloned. Reproducible with multiple algos, though not checked them all.

PHP Version

PHP 8.0+

Operating System

No response

MaxSem added a commit to MaxSem/php-src that referenced this issue Sep 12, 2023
MaxSem added a commit to MaxSem/php-src that referenced this issue Sep 12, 2023
MaxSem added a commit to MaxSem/php-src that referenced this issue Sep 13, 2023
nielsdos added a commit that referenced this issue Sep 16, 2023
* PHP-8.1:
  Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
  Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
  Fix GH-12186: segfault copying/cloning a finalized HashContext
nielsdos added a commit that referenced this issue Sep 16, 2023
* PHP-8.2:
  Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
  Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
  Fix GH-12186: segfault copying/cloning a finalized HashContext
nielsdos added a commit that referenced this issue Sep 16, 2023
* PHP-8.3:
  Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
  Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
  Fix GH-12186: segfault copying/cloning a finalized HashContext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants