Skip to content

ub in gd_interpolation.c #20047

@chongwick

Description

@chongwick

Description

The following code:

<?php
$v_1115 = 1;
$v_2154 = 1;
$v_1078 = 2147483647;
$v_2156 = 1;
$v_2157 = 1;
$v_2158 = 1;
$v_2152 = array(0 => $v_1115,1 => $v_2154,2 => $v_1078,3 => $v_2156,4 => $v_2157,5 => $v_2158,);
$v_2159 = 8;
$v_2160 = 8;
$v_2161 = imagecreatetruecolor($v_2159,$v_2160,);
try{
$v_2165 = imageaffine($v_2161,$v_2152,);
}
catch (ValueError $e){
}

Resulted in this output:

/home/w023dtc/nightly_php/php-src/ext/gd/libgd/gd_interpolation.c:2084:17: runtime error: 1.71799e+10 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

PHP Version

nightly

Operating System

ubuntu 22.04

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