summaryrefslogtreecommitdiff
path: root/ext/sysvshm/sysvshm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sysvshm/sysvshm.c')
-rw-r--r--ext/sysvshm/sysvshm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c
index 1581b7640..da1ad6857 100644
--- a/ext/sysvshm/sysvshm.c
+++ b/ext/sysvshm/sysvshm.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sysvshm.c,v 1.70.2.2 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: sysvshm.c,v 1.70.2.2.2.1 2006/06/29 09:03:27 tony2001 Exp $ */
/* This has been built and tested on Linux 2.2.14
*
@@ -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;
}