From 8800e39694abd03e27c00320004b2d911be806e6 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 3 Dec 2024 21:54:44 +0100 Subject: [PATCH] Don't allow multiple server args to vncviewer Only one is supposed to be specified, so error out instead of ignoring all but one of the arguments. --- vncviewer/vncviewer.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 2bbe4f003..3beaab148 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -697,6 +697,9 @@ int main(int argc, char** argv) if (argv[i][0] == '-') usage(argv[0]); + if (vncServerName[0] != '\0') + usage(argv[0]); + strncpy(vncServerName, argv[i], VNCSERVERNAMELEN); vncServerName[VNCSERVERNAMELEN - 1] = '\0'; i++;