aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian P. Hinz <bphinz@users.sf.net>2017-08-06 15:00:09 -0400
committerBrian P. Hinz <bphinz@users.sf.net>2017-08-06 15:03:57 -0400
commit8081c33861a1d575a67f66a1bef395dd4f7bf282 (patch)
tree5357e52bd96b67d2b2d7c406ead7f050c9827eaa
parent61e25f9187c586715ea61b2279a856532844b036 (diff)
downloadtigervnc-8081c33861a1d575a67f66a1bef395dd4f7bf282.tar.gz
tigervnc-8081c33861a1d575a67f66a1bef395dd4f7bf282.zip
Fixed issue where CLI paramters specified as "-param value" caused
a java.nio.BufferOverflowException while the same parameter specified as "-param=value" worked fine.
-rw-r--r--java/com/tigervnc/vncviewer/VncViewer.java9
1 files changed, 5 insertions, 4 deletions
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();
}