Updates resulting from self-code review.
This commit is contained in:
@@ -101,7 +101,6 @@ AuthTokenIf_GetAuthToken(
|
||||
TimeStamp expiry;
|
||||
CredHandle hCredentials = {0};
|
||||
|
||||
|
||||
DbgTrace(1, "-AuthTokenIf_GetAuthToken- Start\n", 0);
|
||||
|
||||
// Validate input parameters
|
||||
@@ -211,7 +210,9 @@ AuthTokenIf_GetAuthToken(
|
||||
// Return the actual size or the size required
|
||||
*pTokenBufLen = encodedTokenLen;
|
||||
|
||||
// Free the buffer containing the encoded token
|
||||
// Free the buffer containing the encoded token after clearing
|
||||
// its memory to avoid leaking sensitive information.
|
||||
memset(pEncodedToken, 0, strlen(pEncodedToken));
|
||||
free(pEncodedToken);
|
||||
}
|
||||
|
||||
@@ -229,7 +230,10 @@ AuthTokenIf_GetAuthToken(
|
||||
|
||||
// Free any buffer associated with the sendToken
|
||||
if (sendTok.pvBuffer)
|
||||
{
|
||||
memset(sendTok.pvBuffer, 0, sendTok.cbBuffer);
|
||||
FreeContextBuffer(sendTok.pvBuffer);
|
||||
}
|
||||
|
||||
// Free the credential handle obtained
|
||||
FreeCredentialsHandle(&hCredentials);
|
||||
|
||||
Reference in New Issue
Block a user