1
1

When we have less than blocksize data left we MUST (attempt to) read more

since we can't decrypt anything in that situation.
Этот коммит содержится в:
Daniel Stenberg 2007-08-10 22:22:45 +00:00
родитель c4630d1ffb
Коммит f216b36328

Просмотреть файл

@ -267,7 +267,6 @@ libssh2_packet_read(LIBSSH2_SESSION * session)
int numdecrypt;
unsigned char block[MAX_BLOCKSIZE];
int blocksize;
int minimum;
int encrypted = 1;
/*
@ -293,7 +292,6 @@ libssh2_packet_read(LIBSSH2_SESSION * session)
blocksize = 5; /* not strictly true, but we can use 5 here to
make the checks below work fine still */
}
minimum = p->total_num ? p->total_num - p->data_num : blocksize;
/* read/use a whole big chunk into a temporary area stored in
the LIBSSH2_SESSION struct. We will decrypt data from that
@ -308,8 +306,8 @@ libssh2_packet_read(LIBSSH2_SESSION * session)
/* if remainbuf turns negative we have a bad internal error */
assert(remainbuf >= 0);
if (remainbuf < minimum) {
/* If we have less than a minimum left, it is too
if (remainbuf < blocksize) {
/* If we have less than a blocksize left, it is too
little data to deal with, read more */
ssize_t nread;