Skip to content

Out of int range in Zend/zend_strtod.c #15712

Description

@YuanchengJiang

Description

The following code:

<?php
ini_set('precision', 1140973389);
echo "len=", strlen(strval(-1 * pow(2, -10))), "\n";
?>

Resulted in this output:

/php-src/Zend/zend_strtod.c:3617:5: runtime error: left shift of 1073741824 by 1 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/Zend/zend_strtod.c:3617:5

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions