File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -261,13 +261,11 @@ PHP_FUNCTION(pam_auth) {
261261 }
262262 hash_key = zend_string_init ("_SERVER" , sizeof ( "_SERVER" ), 0 );
263263 if (zend_hash_exists (& EG (symbol_table ), hash_key )) {
264- server = zend_hash_find_ind (& EG (symbol_table ), hash_key );
265- if (server != NULL ) {
266- hash_key = zend_string_init ("REMOTE_ADDR" , sizeof ( "REMOTE_ADDR" ), 0 );
267- remote_addr = zend_hash_find_ind (Z_ARRVAL_P (server ), hash_key );
268- if (remote_addr != NULL && Z_TYPE_P (remote_addr )) {
269- pam_set_item (pamh , PAM_RHOST , Z_STRVAL_P (remote_addr ));
270- }
264+ if ((server = zend_hash_str_find (& EG (symbol_table ), "_SERVER" , sizeof ("_SERVER" )- 1 )) != NULL && Z_TYPE_P (server ) == IS_ARRAY
265+ ) {
266+ if ((remote_addr = zend_hash_str_find (Z_ARRVAL_P (server ), "REMOTE_ADDR" , sizeof ("REMOTE_ADDR" )- 1 )) != NULL && Z_TYPE_P (remote_addr ) == IS_STRING ) {
267+ pam_set_item (pamh , PAM_RHOST , Z_STRVAL_P (remote_addr ));
268+ }
271269 }
272270 }
273271
You can’t perform that action at this time.
0 commit comments