mirror of
				https://github.com/yuzu-emu/mbedtls.git
				synced 2025-11-04 14:45:08 +00:00 
			
		
		
		
	Only zeroize buffer if the buffer length is non-zero
This commit is contained in:
		
							parent
							
								
									8593bca7f8
								
							
						
					
					
						commit
						8096cafa94
					
				| 
						 | 
					@ -1235,6 +1235,7 @@ static psa_status_t psa_copy_key_material( const psa_key_slot_t *source,
 | 
				
			||||||
    status = psa_import_key( target, source->type, buffer, length );
 | 
					    status = psa_import_key( target, source->type, buffer, length );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exit:
 | 
					exit:
 | 
				
			||||||
 | 
					    if( buffer_size != 0 )
 | 
				
			||||||
        mbedtls_platform_zeroize( buffer, buffer_size );
 | 
					        mbedtls_platform_zeroize( buffer, buffer_size );
 | 
				
			||||||
    mbedtls_free( buffer );
 | 
					    mbedtls_free( buffer );
 | 
				
			||||||
    return( status );
 | 
					    return( status );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue