mirror of
				https://github.com/libssh2/libssh2.git
				synced 2025-11-03 22:13:11 +03:00 
			
		
		
		
	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:
		
				
					committed by
					
						
						Daniel Stenberg
					
				
			
			
				
	
			
			
			
						parent
						
							2db4863e6e
						
					
				
				
					commit
					ad88325b3f
				
			@@ -199,7 +199,15 @@ fullpacket(LIBSSH2_SESSION * session, int encrypted /* 1 or 0 */ )
 | 
			
		||||
        session->fullpacket_payload_len -= p->padding_length;
 | 
			
		||||
 | 
			
		||||
        /* 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;
 | 
			
		||||
            size_t data_len;
 | 
			
		||||
            rc = session->remote.comp->decomp(session,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user