]> granicus.if.org Git - php/commitdiff
MFH: Improve offset check inside shmop_write().
authorIlia Alshanetsky <iliaa@php.net>
Sat, 27 Nov 2004 18:18:19 +0000 (18:18 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 27 Nov 2004 18:18:19 +0000 (18:18 +0000)
ext/shmop/shmop.c

index 47e3e226e5d7ce24c8f85b2d5de96d0282dca743..2bc32e8138572241a905773ec27881cad21bf525 100644 (file)
@@ -316,7 +316,7 @@ PHP_FUNCTION(shmop_write)
                RETURN_FALSE;
        }
 
-       if (offset > shmop->size) {
+       if (offset < 0 || offset > shmop->size) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "offset out of range");
                RETURN_FALSE;
        }