diff options
author | Antony Dovgal <tony2001@php.net> | 2006-06-29 09:03:27 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-06-29 09:03:27 +0000 |
commit | b8f97db5802f841462446d6fff2812b59754f7d8 (patch) | |
tree | 932670dc7003ec841150c2e6407a5bc70de9eb96 /ext/sysvshm/sysvshm.c | |
parent | 6a43f6805cdfb98d30aa9f96e0865b719781f1c7 (diff) | |
download | php-git-b8f97db5802f841462446d6fff2812b59754f7d8.tar.gz |
MFH: make sure we won't get into endless loop
Diffstat (limited to 'ext/sysvshm/sysvshm.c')
-rw-r--r-- | ext/sysvshm/sysvshm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c index 3c30dda898..a445bf27bf 100644 --- a/ext/sysvshm/sysvshm.c +++ b/ext/sysvshm/sysvshm.c @@ -408,6 +408,10 @@ static long php_check_shm_data(sysvshm_chunk_head *ptr, long key) return pos; } pos += shm_var->next; + + if (shm_var->next <= 0 || pos < ptr->start) { + return -1; + } } return -1; } |