From: Brian P. Hinz Date: Sun, 6 Aug 2017 19:00:09 +0000 (-0400) Subject: Fixed issue where CLI paramters specified as "-param value" caused X-Git-Tag: v1.8.90~125 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8081c33861a1d575a67f66a1bef395dd4f7bf282;p=tigervnc.git Fixed issue where CLI paramters specified as "-param value" caused a java.nio.BufferOverflowException while the same parameter specified as "-param=value" worked fine. --- diff --git a/java/com/tigervnc/vncviewer/VncViewer.java b/java/com/tigervnc/vncviewer/VncViewer.java index e1234994..cab1fc53 100644 --- a/java/com/tigervnc/vncviewer/VncViewer.java +++ b/java/com/tigervnc/vncviewer/VncViewer.java @@ -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(); }