Skip to content

Commit

Permalink
Don't allow multiple server args to vncviewer
Browse files Browse the repository at this point in the history
Only one is supposed to be specified, so error out instead of ignoring
all but one of the arguments.
  • Loading branch information
CendioOssman committed Dec 3, 2024
1 parent fbe098a commit 8800e39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vncviewer/vncviewer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 8800e39

Please sign in to comment.