From: Ilia Alshanetsky Date: Sat, 27 Nov 2004 18:18:09 +0000 (+0000) Subject: MFH: Improve offset check inside shmop_write(). X-Git-Tag: php-5.0.3RC1~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a2fb113bc8a2490ae51401b868158f711a6cb9d;p=php MFH: Improve offset check inside shmop_write(). --- diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index 78d9e1b973..eec73d1573 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -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; }