]> 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)
committerLinn Mattsson <linma@cendio.se>
Tue, 22 Oct 2024 10:41:33 +0000 (12:41 +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.

(cherry picked from commit 49a087e8f8ecafe950a86a71ae6657d6cac8ea77)

vncviewer/UserDialog.cxx

index 7f8b3c8e6aa3b2fb2e7f1ba7270a8e0b458e3708..5b5fda17c60e7a99f30f3088797ac84ceefaa2e3 100644 (file)
@@ -91,7 +91,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");