summaryrefslogtreecommitdiff
path: root/ext/sysvshm
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-12-30 20:46:47 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-12-30 20:46:47 +0000
commit5298554fb69c5c7e428b3feb6cec164391b00eb7 (patch)
tree55d4e9973d2cea8274493ab23d938507e974c876 /ext/sysvshm
parent3ca748d49cab3a7bc2a75fe19d60c3a0ca5228cc (diff)
downloadphp-git-5298554fb69c5c7e428b3feb6cec164391b00eb7.tar.gz
Added missing resource validation checks
Diffstat (limited to 'ext/sysvshm')
-rw-r--r--ext/sysvshm/sysvshm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c
index a445bf27bf..90730fb31f 100644
--- a/ext/sysvshm/sysvshm.c
+++ b/ext/sysvshm/sysvshm.c
@@ -216,7 +216,7 @@ PHP_FUNCTION(shm_remove)
id = Z_LVAL_PP(arg_id);
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
- if (!shm_list_ptr) {
+ if (!shm_list_ptr || type != php_sysvshm.le_shm) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The parameter is not a valid shm_identifier");
RETURN_FALSE;
}
@@ -252,7 +252,7 @@ PHP_FUNCTION(shm_put_var)
key = Z_LVAL_PP(arg_key);
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
- if (type != php_sysvshm.le_shm) {
+ if (!shm_list_ptr || type != php_sysvshm.le_shm) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
RETURN_FALSE;
}
@@ -299,7 +299,7 @@ PHP_FUNCTION(shm_get_var)
key = Z_LVAL_PP(arg_key);
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
- if (type != php_sysvshm.le_shm) {
+ if (!shm_list_ptr || type != php_sysvshm.le_shm) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
RETURN_FALSE;
}
@@ -345,7 +345,7 @@ PHP_FUNCTION(shm_remove_var)
key = Z_LVAL_PP(arg_key);
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
- if (type != php_sysvshm.le_shm) {
+ if (!shm_list_ptr || type != php_sysvshm.le_shm) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
RETURN_FALSE;
}