Skip to content
Permalink
Browse files

'p->total_num' instead total_num

  • Loading branch information...
Your Name
Your Name committed Apr 24, 2019
1 parent 58a9c7c commit 7a8f75f5c123dc3f5a91ac1a3e0ffcf43f5ee849
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/transport.c
@@ -281,7 +281,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
unsigned char block[MAX_BLOCKSIZE];
int blocksize;
int encrypted = 1;
size_t total_num = 0;
size_t total_num;

/* default clear the bit */
session->socket_block_directions &= ~LIBSSH2_SESSION_BLOCK_INBOUND;
@@ -565,7 +565,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
copy them as-is to the target buffer */
if(numbytes > 0) {

if((size_t)numbytes <= (total_num - (p->wptr - p->payload))) {
if((size_t)numbytes <= (p->total_num - (p->wptr - p->payload))) {
memcpy(p->wptr, &p->buf[p->readidx], numbytes);
}
else {

0 comments on commit 7a8f75f

Please sign in to comment.
You can’t perform that action at this time.