Skip to contentSkip to conversation

[5707] r5531 made x509 certs not loadable (original patch from Henrik Holst ).

Qemu-devel Andrzej Zaborowski 1 participant 1 message Nov 12, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5707

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5707
Author:   balrog
Date:     2008-11-12 16:50:36 +0000 (Wed, 12 Nov 2008)

Log Message:
-----------
r5531 made x509 certs not loadable (original patch from Henrik Holst).

The patch in r5531 which replaced a bunch of strncpy with pstrcpy causes the x509 credentials from the -vnc parameter to be one character shorter than entered meaning that there is currently no way to enter x509 certificates...

Modified Paths:
--------------
trunk/vnc.c

Modified: trunk/vnc.c
===================================================================

vnc.c +1 -3
@@ -2329,10 +2329,8 @@
 	    end = strchr(options, ',');
 	    if (start && (!end || (start < end))) {
 		int len = end ? end-(start+1) : strlen(start+1);
-		char *path = qemu_malloc(len+1);
+		char *path = qemu_strndup(start + 1, len);
 
-                pstrcpy(path, len, start + 1);
-		path[len] = '\0';
 		VNC_DEBUG("Trying certificate path '%s'\n", path);
 		if (vnc_set_x509_credential_dir(vs, path) < 0) {
 		    fprintf(stderr, "Failed to find x509 certificates/keys in %s\n", path);