summaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-12 16:50:36 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-12 16:50:36 +0000
commitbe3512610bdeebfaa40c63ae15d19d9fae991e1b (patch)
tree99bc37c7623244bc8e97fdb53953f697c35c64c4 /vnc.c
parent9167a69a816b8956d62da628b5b4dc87674647d6 (diff)
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... git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5707 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/vnc.c b/vnc.c
index f0ebebd5d..01bcc8d2b 100644
--- a/vnc.c
+++ b/vnc.c
@@ -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);