Skip to content

undefined behavior in gd_interpolation.c #19730

Description

@chongwick

Description

The following code:

<?php
$v_426189 = '2008-05-23 00:00:00 +08';
$v_426190 = strtotime($v_426189,);
$v_426175 = 1;
$v_426176 = 1;
$v_426177 = 1;
$v_426178 = 1;
$v_426179 = 1;
$v_426173 = array(0 => $v_426190,1 => $v_426175,2 => $v_426176,3 => $v_426177,4 => $v_426178,5 => $v_426179,);
$v_426180 = 8;
$v_426181 = 8;
$v_426182 = imagecreatetruecolor($v_426180,$v_426181,);
try{
$v_426173 = array(0 => $v_426190,1 => $v_426175,2 => $v_426176,3 => $v_426177,4 => $v_426178,5 => $v_426179,);
$v_426186 = imageaffine($v_426182,$v_426173,);
}
catch (ValueError $e){
$v_426183 = $e->getMessage();
$v_426192 = '2008-05-23 00:00:00';
$v_426185 = $v_426192 . $v_426190;
}

Resulted in this output:

/nightly_php/php-src/ext/gd/libgd/gd_interpolation.c:2084:17: runtime error: 9.69178e+09 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/w023dtc/nightly_php/php-src/ext/gd/libgd/gd_interpolation.c:2084:17

But I expected this output instead:

PHP Version

nightly

Operating System

ubuntu 20.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