Diff of /lib/tpm_utils.c [ddf5f3] .. [c85d95]  Maximize  Restore

  Switch to side-by-side view

--- a/lib/tpm_utils.c
+++ b/lib/tpm_utils.c
@@ -69,7 +69,7 @@
 	if ( a_pszShortOpts )
 		strcat( szShortOpts, a_pszShortOpts );
 
-	memset( sLongOpts, 0, sizeof( sLongOpts ) );
+	__memset( sLongOpts, 0, sizeof( sLongOpts ) );
 	memcpy( sLongOpts, sGenLongOpts, sizeof( sGenLongOpts ) );
 	if ( a_sLongOpts ) {
 		memcpy( sLongOpts + iNumGenLongOpts,
@@ -134,6 +134,12 @@
 	return 0;
 }
 
+void * __no_optimize
+__memset(void *s, int c, size_t n)
+{
+	return memset(s, c, n);
+}
+
 /*
  * This function should be called when you are done with a password
  * the above getPasswd function to properly clean up.
@@ -141,7 +147,7 @@
 void shredPasswd( char *a_pszPasswd ) {
 
 	if ( a_pszPasswd ) {
-		memset( a_pszPasswd, 0, strlen( a_pszPasswd ) );
+		__memset( a_pszPasswd, 0, strlen( a_pszPasswd ) );
 		free( a_pszPasswd );
 	}
 }
@@ -213,7 +219,7 @@
 
 	// pszPasswd is a static buffer, just clear it
 	if ( pszPasswd )
-		memset( pszPasswd, 0, strlen( pszPasswd ) );
+		__memset( pszPasswd, 0, strlen( pszPasswd ) );
 
 	return pszRetPasswd;
 }