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 <[EMAIL PROTECTED]>                         |
    +----------------------------------------------------------------------+
  */
-/* $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");

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to