mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.2'
* PHP-8.2: shmget() with IPC_CREAT must not create 0 size SHM
This commit is contained in:
@@ -645,7 +645,7 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
||||
|
||||
if (!shm_handle) {
|
||||
if (flags & IPC_CREAT) {
|
||||
if (size > SIZE_MAX - sizeof(shm->descriptor)) {
|
||||
if (size == 0 || size > SIZE_MAX - sizeof(shm->descriptor)) {
|
||||
return -1;
|
||||
}
|
||||
size += sizeof(shm->descriptor);
|
||||
|
||||
Reference in New Issue
Block a user