mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Fix uncaught error if fix_negative fails
fix_negative allocates memory for its result. The calling site didn't check the return value, so an out-of-memory error could lead to an incorrect calculation. Fix this. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
		
							parent
							
								
									89b4130098
								
							
						
					
					
						commit
						e54be3a9c3
					
				@ -1033,7 +1033,7 @@ static inline void sub32( uint32_t *dst, uint32_t src, signed char *carry )
 | 
			
		||||
    STORE32; i++;                               \
 | 
			
		||||
    cur = c > 0 ? c : 0; STORE32;               \
 | 
			
		||||
    cur = 0; while( ++i < MAX32 ) { STORE32; }  \
 | 
			
		||||
    if( c < 0 ) fix_negative( N, c, &C, bits );
 | 
			
		||||
    if( c < 0 ) MBEDTLS_MPI_CHK( fix_negative( N, c, &C, bits ) );
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * If the result is negative, we get it in the form
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user