php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #72150
Patch ssh2-env.patch revision 2016-05-06 16:17 UTC by krakjoe@php.net

Patch ssh2-env.patch for ssh2 Bug #72150

Patch version 2016-05-06 16:17 UTC

Return to Bug #72150 | Download this patch
Patch Revisions:

Developer: krakjoe@php.net

diff --git a/ssh2_fopen_wrappers.c b/ssh2_fopen_wrappers.c
index 34fb04e..47fdae8 100644
--- a/ssh2_fopen_wrappers.c
+++ b/ssh2_fopen_wrappers.c
@@ -737,13 +737,14 @@ static php_stream *php_ssh2_exec_command(LIBSSH2_SESSION *session, int resource_
 	}
 
 	if (environment) {
-		zend_string *key;
+		zend_string *key = NULL;
 		int key_type;
-		ulong idx;
+		ulong idx = 0;
+		HashPosition pos;
 
-		for(zend_hash_internal_pointer_reset(HASH_OF(environment));
-			(key_type = zend_hash_get_current_key_ex(HASH_OF(environment), &key, &idx, NULL)) != HASH_KEY_NON_EXISTENT;
-			zend_hash_move_forward(HASH_OF(environment))) {
+		for(zend_hash_internal_pointer_reset_ex(HASH_OF(environment), &pos);
+			(key_type = zend_hash_get_current_key_ex(HASH_OF(environment), &key, &idx, &pos)) != HASH_KEY_NON_EXISTENT;
+			zend_hash_move_forward_ex(HASH_OF(environment), &pos)) {
 			if (key_type == HASH_KEY_IS_STRING) {
 				zval *value;
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC