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

index 6fe70f30b401c0fc1caed7be9288162b7f41887b..ec292bd905e826f7d3912bf226f01ca509c8c979 100644 (file)
@@ -310,7 +310,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;
        }