aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-09-14 18:34:53 +0200
committerAndreas Schneider <mail@cynapses.org>2009-09-14 19:00:28 +0200
commit7cd327a79580cb3f11bed867ea3dafb72c62069d (patch)
treef59318c5fbe7003b3fc358c964c23b91f8042423
parent77a757c728eee9063492e12fd7f1d59d38082c2c (diff)
downloadlibssh-7cd327a79580cb3f11bed867ea3dafb72c62069d.tar.gz
libssh-7cd327a79580cb3f11bed867ea3dafb72c62069d.tar.xz
libssh-7cd327a79580cb3f11bed867ea3dafb72c62069d.zip
Fix a possible stack overflow in agent code.
-rw-r--r--libssh/agent.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libssh/agent.c b/libssh/agent.c
index d4b4a1b3..057f1b35 100644
--- a/libssh/agent.c
+++ b/libssh/agent.c
@@ -210,10 +210,7 @@ static int agent_talk(struct ssh_session *session,
/* send length and then the request packet */
if (atomicio(session->agent->sock, payload, 4, 0) == 4) {
- buffer_get_data(request, payload, len);
- ssh_log(session, SSH_LOG_PACKET,
- "agent_talk - sending request, payload[0] = %u", payload[0]);
- if (atomicio(session->agent->sock, payload, len, 0)
+ if (atomicio(session->agent->sock, buffer_get_rest(request), len, 0)
!= len) {
ssh_log(session, SSH_LOG_PACKET, "atomicio sending request failed: %s",
strerror(errno));