aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-11-14 11:42:21 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-11-14 11:44:11 +0100
commit2eaff2b3630fcac754abaa69cd1c33dbda67118b (patch)
treec63b3fe9b30763171b83332091fcdff32ae38422
parent2b3e69fd5f40ddfaffcdf63f37d489ab17632170 (diff)
downloadlibssh-2eaff2b3630fcac754abaa69cd1c33dbda67118b.tar.gz
libssh-2eaff2b3630fcac754abaa69cd1c33dbda67118b.tar.xz
libssh-2eaff2b3630fcac754abaa69cd1c33dbda67118b.zip
packet: Set the packet to the processed data position.
Else we could end up with packet - current_macsize if to_be_read is 0.
-rw-r--r--src/packet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/packet.c b/src/packet.c
index 089a2a6a..c6c30bdb 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -263,7 +263,7 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user)
}
/* copy the last part from the incoming buffer */
- packet = packet + to_be_read - current_macsize;
+ packet = ((uint8_t *)data) + processed;
if (packet == NULL) {
goto error;
}