Skip to content

Commit

Permalink
Explicitly blank password before free
Browse files Browse the repository at this point in the history
This stops the password from potentially being exposed after archive freed
It does not stop the password being exposed whilst the archive is open
  • Loading branch information
chris-y committed Aug 16, 2023
1 parent 8068251 commit 7f338ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xad.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ static void xad_free_pw(void *awin)
struct xad_userdata *xu = (struct xad_userdata *)window_get_archive_userdata(awin);

if(xu->pw) {
for(int i = 0; i < strlen(xu->pw); i++)
xu->pw[i] = '\0';

FreeVec(xu->pw);
xu->pw = NULL;
}
Expand Down

0 comments on commit 7f338ca

Please sign in to comment.