Skip to content

zend_alloc bin 0 may leak #22516

Description

@ndossche

Description

Value set analysis shows that ZEND_MM_SRUN_FREE_COUNTER macro can return a value in the interval [0, 511].
However, bin 0 from ZEND_MM_BINS_INFO has 512 free elements.
So the following check cannot fire:

if (ZEND_MM_SRUN_FREE_COUNTER(info) == bin_elements[bin_num]) {

Found using SAST.

PHP Version

master

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions