]> source.dussan.org Git - tigervnc.git/commitdiff
Only read first password from file
authorPierre Ossman <ossman@cendio.se>
Fri, 30 Aug 2024 14:09:38 +0000 (16:09 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 30 Aug 2024 14:09:38 +0000 (16:09 +0200)
Read just the first password and ignore anything else in the password
file. This allows you to reuse a password file from the server that also
includes a view-only password.

This fixes a regression introduced in b99daad.

vncviewer/UserDialog.cxx

index 901503c6dd842c21e7adb61f85dad8914b2f45ea..13821a9c54f022d979fc43a596cf20fcc2a0c595 100644 (file)
@@ -109,7 +109,7 @@ void UserDialog::getUserPasswd(bool secure_, std::string* user,
   }
 
   if (!user && passwordFileName[0]) {
-    std::vector<uint8_t> obfPwd(256);
+    std::vector<uint8_t> obfPwd(8);
     FILE* fp;
 
     fp = fopen(passwordFileName, "rb");