diff options
Diffstat (limited to 'ext/shmop/shmop.c')
-rw-r--r-- | ext/shmop/shmop.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index 446c309458..d718c429c9 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -176,6 +176,11 @@ PHP_FUNCTION(shmop_open) goto err; } + if (shm.shm_segsz > ZEND_LONG_MAX) { + php_error_docref(NULL, E_WARNING, "shared memory segment too large to attach"); + goto err; + } + shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg); if (shmop->addr == (char*) -1) { php_error_docref(NULL, E_WARNING, "Unable to attach to shared memory segment '%s'", strerror(errno)); |