Skip to content

Segfault in hash_copy() on a finalized context #12186

Closed
@MaxSem

Description

@MaxSem

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions