mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Check whether INT_MAX larger than SIZE_MAX scenario
Check whether INT_MAX larger than SIZE_MAX scenario
This commit is contained in:
		
							parent
							
								
									b878805919
								
							
						
					
					
						commit
						52aecb9a7f
					
				@ -2422,7 +2422,7 @@ int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want )
 | 
				
			|||||||
            if( ret < 0 )
 | 
					            if( ret < 0 )
 | 
				
			||||||
                return( ret );
 | 
					                return( ret );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ( (size_t)ret > len )
 | 
					            if ( (size_t)ret > len || ( INT_MAX > SIZE_MAX && ret > SIZE_MAX ) )
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                MBEDTLS_SSL_DEBUG_MSG( 1, 
 | 
					                MBEDTLS_SSL_DEBUG_MSG( 1, 
 | 
				
			||||||
                    ( "f_recv returned %d bytes but only %zu were requested", 
 | 
					                    ( "f_recv returned %d bytes but only %zu were requested", 
 | 
				
			||||||
@ -2477,7 +2477,7 @@ int mbedtls_ssl_flush_output( mbedtls_ssl_context *ssl )
 | 
				
			|||||||
        if( ret <= 0 )
 | 
					        if( ret <= 0 )
 | 
				
			||||||
            return( ret );
 | 
					            return( ret );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if( (size_t)ret > ssl->out_left )
 | 
					        if( (size_t)ret > ssl->out_left || ( INT_MAX > SIZE_MAX && ret > SIZE_MAX ) )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            MBEDTLS_SSL_DEBUG_MSG( 1, 
 | 
					            MBEDTLS_SSL_DEBUG_MSG( 1, 
 | 
				
			||||||
                ( "f_send returned %d bytes but only %zu bytes were sent", 
 | 
					                ( "f_send returned %d bytes but only %zu bytes were sent", 
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user