mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.3'
* PHP-8.3: Fix undefined behavior (left shift of negative number)
This commit is contained in:
commit
2d66993c64
1 changed files with 3 additions and 3 deletions
|
@ -749,10 +749,10 @@ static signed short php_ifd_get16s(void *Short, int motorola_intel)
|
|||
static int php_ifd_get32s(void *Long, int motorola_intel)
|
||||
{
|
||||
if (motorola_intel) {
|
||||
return ((( char *)Long)[0] << 24) | (((unsigned char *)Long)[1] << 16)
|
||||
| (((unsigned char *)Long)[2] << 8 ) | (((unsigned char *)Long)[3] << 0 );
|
||||
return ((unsigned)((( char *)Long)[0]) << 24) | (((unsigned char *)Long)[1] << 16)
|
||||
| ((( char *)Long)[2] << 8 ) | (((unsigned char *)Long)[3] << 0 );
|
||||
} else {
|
||||
return ((( char *)Long)[3] << 24) | (((unsigned char *)Long)[2] << 16)
|
||||
return ((unsigned)((( char *)Long)[3]) << 24) | (((unsigned char *)Long)[2] << 16)
|
||||
| (((unsigned char *)Long)[1] << 8 ) | (((unsigned char *)Long)[0] << 0 );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue