Skip to content

undefined behavior in bzcompress #20620

@chongwick

Description

@chongwick

Description

The following code:

<?php
$v_8786 = '.';
$v_8787 = 1;
$v_8788 = 1;
$v_8789 = 1;
$v_8790 = bzcompress($v_8787,$v_8788,$v_8789,);
$v_7209 = 'B';
$v_7210 = 65537;
$v_7211 = str_repeat($v_7209,$v_7210,);
$v_7212 = 1;
$v_7213 = 'B';
$v_7214 = 65537;
$v_7215 = str_repeat($v_7213,$v_7214,);
$v_7216 = chunk_split($v_7211,$v_7212,$v_7215,);
$v_8792 = bzcompress($v_7216,);
$v_8795 = bzcompress($v_8786,$v_8788,$v_8792,);

Resulted in this output:

/home/w023dtc/nightly_php/php-src/ext/bz2/bz2.c:480:13: runtime error: 4.33812e+09 is outside the range of representable values of type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/w023dtc/nightly_php/php-src/ext/bz2/bz2.c:480:13
USE_ZEND_ALLOC=0

PHP Version

nightly

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions