Skip to content

Commit

Permalink
rfbEncryptAndStorePasswd: fail if encryption fails
Browse files Browse the repository at this point in the history
  • Loading branch information
chhitz committed Mar 27, 2024
1 parent 042a816 commit c192315
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/common/vncauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ rfbEncryptAndStorePasswd(char *passwd, char *fname)

/* Do encryption in-place - this way we overwrite our copy of the plaintext
password */
encrypt_rfbdes(encryptedPasswd, &out_len, fixedkey, encryptedPasswd, sizeof(encryptedPasswd));
if (encrypt_rfbdes(encryptedPasswd, &out_len, fixedkey, encryptedPasswd, sizeof(encryptedPasswd)) == 0) {
fclose(fp);
return 1;
}

for (i = 0; i < 8; i++) {
putc(encryptedPasswd[i], fp);
Expand Down

0 comments on commit c192315

Please sign in to comment.