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(E_WARNING, "The parameter is not a valid shm_identifier");
RETURN_FALSE;
}
}
RETURN_TRUE;
-}
+}
/* }}} */
/* {{{ proto int shm_put_var(int shm_identifier, int variable_key, mixed variable)
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(E_WARNING, "%ld is not a SysV shared memory index", id);
RETURN_FALSE;
}
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(E_WARNING, "%ld is not a SysV shared memory index", id);
RETURN_FALSE;
}
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(E_WARNING, "%ld is not a SysV shared memory index", id);
RETURN_FALSE;
}