]> source.dussan.org Git - tigervnc.git/commitdiff
Fixed issue where CLI paramters specified as "-param value" caused
authorBrian P. Hinz <bphinz@users.sf.net>
Sun, 6 Aug 2017 19:00:09 +0000 (15:00 -0400)
committerBrian P. Hinz <bphinz@users.sf.net>
Sun, 6 Aug 2017 19:03:57 +0000 (15:03 -0400)
a java.nio.BufferOverflowException while the same parameter specified
as "-param=value" worked fine.

java/com/tigervnc/vncviewer/VncViewer.java

index e1234994d4cd885194d1ef44bb0931d004955602..cab1fc53f652a7f0fc83860eb0850b1c7d05b12c 100644 (file)
@@ -173,7 +173,8 @@ public class VncViewer extends javax.swing.JApplet
     }
 
     // Override defaults with command-line options
-    for (int i = 0; i < argv.length; i++) {
+    int i = 0;
+    for (; i < argv.length; i++) {
       if (argv[i].length() == 0)
         continue;
 
@@ -191,9 +192,6 @@ public class VncViewer extends javax.swing.JApplet
         continue;
       }
 
-      if (Configuration.setParam(argv[i]))
-        continue;
-
       if (argv[i].charAt(0) == '-') {
         if (i+1 < argv.length) {
           if (Configuration.setParam(argv[i].substring(1), argv[i+1])) {
@@ -201,6 +199,9 @@ public class VncViewer extends javax.swing.JApplet
             continue;
           }
         }
+        if (Configuration.setParam(argv[i]))
+          continue;
+
         usage();
       }