mirror of
				https://github.com/yuzu-emu/mbedtls.git
				synced 2025-11-04 15:05:06 +00:00 
			
		
		
		
	Improve parameter validation in mbedtls_gcm_free()
This commit is contained in:
		
							parent
							
								
									9af22e4790
								
							
						
					
					
						commit
						21298a20c4
					
				| 
						 | 
					@ -298,7 +298,7 @@ int mbedtls_gcm_finish( mbedtls_gcm_context *ctx,
 | 
				
			||||||
 *                  cipher sub-context.
 | 
					 *                  cipher sub-context.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * \param ctx       The GCM context to clear. If this is \c NULL, the call has
 | 
					 * \param ctx       The GCM context to clear. If this is \c NULL, the call has
 | 
				
			||||||
 *                  no effect.
 | 
					 *                  no effect. Otherwise, this must be initialized.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void mbedtls_gcm_free( mbedtls_gcm_context *ctx );
 | 
					void mbedtls_gcm_free( mbedtls_gcm_context *ctx );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -541,9 +541,8 @@ int mbedtls_gcm_auth_decrypt( mbedtls_gcm_context *ctx,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void mbedtls_gcm_free( mbedtls_gcm_context *ctx )
 | 
					void mbedtls_gcm_free( mbedtls_gcm_context *ctx )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if( ctx == NULL ) {
 | 
					    if( ctx == NULL )
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    mbedtls_cipher_free( &ctx->cipher_ctx );
 | 
					    mbedtls_cipher_free( &ctx->cipher_ctx );
 | 
				
			||||||
    mbedtls_platform_zeroize( ctx, sizeof( mbedtls_gcm_context ) );
 | 
					    mbedtls_platform_zeroize( ctx, sizeof( mbedtls_gcm_context ) );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue