Index: vnc.c =================================================================== --- vnc.c (revision 5668) +++ vnc.c (arbetskopia) @@ -2338,8 +2338,7 @@ int len = end ? end-(start+1) : strlen(start+1); char *path = qemu_malloc(len+1); - pstrcpy(path, len, start + 1); - path[len] = '\0'; + pstrcpy(path, len + 1, start + 1); 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);