]> git.proxmox.com Git - qemu.git/commitdiff
vnc: fix no-lock-key-sync strncmp() length
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 6 Jan 2012 16:57:45 +0000 (16:57 +0000)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 13 Jan 2012 10:36:59 +0000 (10:36 +0000)
The no-lock-key-sync option is being parsed incorrectly because of an
outdated strcmp() length value.  Use the correct length so that invalid
option names do not match.

Reported-by: Dr David Alan Gilbert <davidagilbert@uk.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
ui/vnc.c

index 6767ada7d2abe8286c1d00adc4432c62f1525f59..1869a7adeac05f0512a00fac107751d2c3f625e8 100644 (file)
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2763,7 +2763,7 @@ int vnc_display_open(DisplayState *ds, const char *display)
             password = 1; /* Require password auth */
         } else if (strncmp(options, "reverse", 7) == 0) {
             reverse = 1;
-        } else if (strncmp(options, "no-lock-key-sync", 9) == 0) {
+        } else if (strncmp(options, "no-lock-key-sync", 16) == 0) {
             lock_key_sync = 0;
 #ifdef CONFIG_VNC_SASL
         } else if (strncmp(options, "sasl", 4) == 0) {