From 76fd96e63e478a0eb78d89a64e6f5101dea1391d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 May 2010 23:19:46 +0200 Subject: [PATCH] agent: win32: fix bad _libssh2_store_str call As pointed out by Grubsky Grigory , I made a mistake when I added the _libssh2_store_str() call before and I made a slightly different patch than what he suggested. Based purely on taste. --- src/agent.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agent.c b/src/agent.c index b0a112ea..975ffa51 100644 --- a/src/agent.c +++ b/src/agent.c @@ -268,6 +268,7 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx) char mapname[23]; HANDLE filemap; unsigned char *p; + unsigned char *p2; int id; COPYDATASTRUCT cds; @@ -284,8 +285,8 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx) if (filemap == NULL || filemap == INVALID_HANDLE_VALUE) { return -1; } - p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0); - _libssh2_store_str(p, transctx->request, transctx->request_len); + p2 = p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0); + _libssh2_store_str(&p2, transctx->request, transctx->request_len); cds.dwData = PAGEANT_COPYDATA_ID; cds.cbData = 1 + strlen(mapname);