From 8081c33861a1d575a67f66a1bef395dd4f7bf282 Mon Sep 17 00:00:00 2001 From: "Brian P. Hinz" Date: Sun, 6 Aug 2017 15:00:09 -0400 Subject: [PATCH] Fixed issue where CLI paramters specified as "-param value" caused a java.nio.BufferOverflowException while the same parameter specified as "-param=value" worked fine. --- java/com/tigervnc/vncviewer/VncViewer.java | 9 +++++---- 1 file 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(); } -- 2.39.5