mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Add safety for NULL tag being passed to finish
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
		
							parent
							
								
									8ff74217e4
								
							
						
					
					
						commit
						ec95cc9489
					
				@ -3760,10 +3760,13 @@ exit:
 | 
			
		||||
     * Even if the operation succeeds, make sure we clear the rest of the
 | 
			
		||||
     * buffer to prevent potential leakage of anything previously placed in
 | 
			
		||||
     * the same buffer.*/
 | 
			
		||||
    if( status != PSA_SUCCESS )
 | 
			
		||||
        memset( tag, '!', tag_size );
 | 
			
		||||
    else if( *tag_length < tag_size )
 | 
			
		||||
        memset( tag + *tag_length, '!', ( tag_size - *tag_length ) );
 | 
			
		||||
    if( tag )
 | 
			
		||||
    {
 | 
			
		||||
        if( status != PSA_SUCCESS )
 | 
			
		||||
            memset( tag, '!', tag_size );
 | 
			
		||||
        else if( *tag_length < tag_size )
 | 
			
		||||
            memset( tag + *tag_length, '!', ( tag_size - *tag_length ) );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    psa_aead_abort( operation );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user