Commit c20a0dc6 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winscard: Use SecureZeroMemory() to clear magic fields.

parent 4502eb56
...@@ -205,7 +205,8 @@ LONG WINAPI SCardReleaseContext( SCARDCONTEXT context ) ...@@ -205,7 +205,8 @@ LONG WINAPI SCardReleaseContext( SCARDCONTEXT context )
params.handle = handle->unix_handle; params.handle = handle->unix_handle;
ret = UNIX_CALL( scard_release_context, &params ); ret = UNIX_CALL( scard_release_context, &params );
handle->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory( &handle->magic, sizeof(handle->magic) );
free( handle ); free( handle );
TRACE( "returning %#lx\n", ret ); TRACE( "returning %#lx\n", ret );
...@@ -794,7 +795,8 @@ LONG WINAPI SCardDisconnect( SCARDHANDLE connect, DWORD disposition ) ...@@ -794,7 +795,8 @@ LONG WINAPI SCardDisconnect( SCARDHANDLE connect, DWORD disposition )
params.disposition = disposition; params.disposition = disposition;
if (!(ret = UNIX_CALL( scard_disconnect, &params ))) if (!(ret = UNIX_CALL( scard_disconnect, &params )))
{ {
handle->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory( &handle->magic, sizeof(handle->magic) );
free( handle ); free( handle );
} }
TRACE( "returning %#lx\n", ret ); TRACE( "returning %#lx\n", ret );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment