diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2007-02-24 15:50:54 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2007-02-24 15:50:54 +0000 |
| commit | a2a55daf213a1ad0925914abe55013be796dd35c (patch) | |
| tree | b6746d47d49edf6385640ff227a5a60960403c79 | |
| parent | 1b8a85415d88a7618abb0bf947e471e1d535854c (diff) | |
| download | php-git-a2a55daf213a1ad0925914abe55013be796dd35c.tar.gz | |
Segment size validation
| -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 397fd59e1e..645434d787 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -169,6 +169,11 @@ PHP_FUNCTION(shmop_open) goto err; } + if (shmop->size < 1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Shared memory segment size must be greater then zero."); + goto err; + } + shmop->shmid = shmget(shmop->key, shmop->size, shmop->shmflg); if (shmop->shmid == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach or create shared memory segment"); |
