diff options
-rw-r--r-- | vnc.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -2329,10 +2329,8 @@ int vnc_display_open(DisplayState *ds, const char *display) 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); |