From 0502bfcfbc92fb023ee249404e753226f6fed898 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 15 May 2020 11:16:50 +0200 Subject: [PATCH] Fixed BehaviorSanitizer warnings --- winpr/libwinpr/sspi/sspi_winpr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/winpr/libwinpr/sspi/sspi_winpr.c b/winpr/libwinpr/sspi/sspi_winpr.c index 5bd897d02..7db9b0e00 100644 --- a/winpr/libwinpr/sspi/sspi_winpr.c +++ b/winpr/libwinpr/sspi/sspi_winpr.c @@ -241,9 +241,12 @@ void sspi_CredentialsFree(SSPI_CREDENTIALS* credentials) passwordLength *= 2; } - memset(credentials->identity.User, 0, userLength); - memset(credentials->identity.Domain, 0, domainLength); - memset(credentials->identity.Password, 0, passwordLength); + if (credentials->identity.User) + memset(credentials->identity.User, 0, userLength); + if (credentials->identity.Domain) + memset(credentials->identity.Domain, 0, domainLength); + if (credentials->identity.Password) + memset(credentials->identity.Password, 0, passwordLength); free(credentials->identity.User); free(credentials->identity.Domain); free(credentials->identity.Password);