cvs: php-src(PHP_5_2) /ext/shmop shmop.c
| From: | Ilia Alshanetsky | Date: | Sat, 24 Feb 2007 15:50:54 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/shmop shmop.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-43254@lists.php.net to get a copy of this message | ||
iliaa Sat Feb 24 15:50:54 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/shmop shmop.c
Log:
Segment size validation
http://cvs.php.net/viewvc.cgi/php-src/ext/shmop/shmop.c?r1=1.31.2.2.2.3&r2=1.31.2.2.2.4&diff_format=u
Index: php-src/ext/shmop/shmop.c
diff -u php-src/ext/shmop/shmop.c:1.31.2.2.2.3 php-src/ext/shmop/shmop.c:1.31.2.2.2.4
--- php-src/ext/shmop/shmop.c:1.31.2.2.2.3 Mon Jan 1 09:36:06 2007
+++ php-src/ext/shmop/shmop.c Sat Feb 24 15:50:54 2007
@@ -16,7 +16,7 @@
| Ilia Alshanetsky <ilia@prohost.org> |
+----------------------------------------------------------------------+
*/
-/* $Id: shmop.c,v 1.31.2.2.2.3 2007/01/01 09:36:06 sebastian Exp $ */
+/* $Id: shmop.c,v 1.31.2.2.2.4 2007/02/24 15:50:54 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -169,6 +169,11 @@
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");