Description
The field compressed_filesize is a uint32_t, but PharFileInfo::getCompressedSize() returns it with RETURN_LONG:
|
RETURN_LONG(entry_obj->entry->compressed_filesize); |
zend_long is 32-bit on 32-bit platforms:
|
typedef int32_t zend_long; |
|
typedef uint32_t zend_ulong; |
|
typedef int32_t zend_off_t; |
|
# define ZEND_LONG_MAX INT32_MAX |
|
# define ZEND_LONG_MIN INT32_MIN |
|
# define ZEND_ULONG_MAX UINT32_MAX |
|
# define Z_L(i) INT32_C(i) |
|
# define Z_UL(i) UINT32_C(i) |
|
# define SIZEOF_ZEND_LONG 4 |
so a size above INT32_MAX is reported as a negative number.
Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Reporter: Pavel Nekrasov (p.nekrasov@fobos-nt.ru).
PHP Version
Operating System
No response
Description
The field compressed_filesize is a uint32_t, but PharFileInfo::getCompressedSize() returns it with RETURN_LONG:
php-src/ext/phar/phar_object.c
Line 4497 in fca7284
zend_long is 32-bit on 32-bit platforms:
php-src/Zend/zend_long.h
Lines 41 to 49 in fca7284
so a size above INT32_MAX is reported as a negative number.
Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Reporter: Pavel Nekrasov (p.nekrasov@fobos-nt.ru).
PHP Version
Operating System
No response