fullpacket: decompression only after init
The buffer for the decompression (remote.comp_abstract) is initialised in time when it is needed. With this fix decompression is disabled when the buffer (remote.comp_abstract) is not initialised. Bug: http://trac.libssh2.org/ticket/200
This commit is contained in:
parent
2db4863e6e
commit
ad88325b3f
@ -199,7 +199,15 @@ fullpacket(LIBSSH2_SESSION * session, int encrypted /* 1 or 0 */ )
|
|||||||
session->fullpacket_payload_len -= p->padding_length;
|
session->fullpacket_payload_len -= p->padding_length;
|
||||||
|
|
||||||
/* Check for and deal with decompression */
|
/* Check for and deal with decompression */
|
||||||
if (session->remote.comp && session->remote.comp->compress) {
|
if (session->remote.comp &&
|
||||||
|
session->remote.comp->compress &&
|
||||||
|
session->remote.comp_abstract) {
|
||||||
|
/*
|
||||||
|
* The buffer for the decompression (remote.comp_abstract) is
|
||||||
|
* initialised in time when it is needed so as long it is NULL we
|
||||||
|
* cannot decompress.
|
||||||
|
*/
|
||||||
|
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
size_t data_len;
|
size_t data_len;
|
||||||
rc = session->remote.comp->decomp(session,
|
rc = session->remote.comp->decomp(session,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user