Commit be3512610bdeebfaa40c63ae15d19d9fae991e1b

Authored by balrog
1 parent 9167a69a

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
Showing 1 changed file with 1 additions and 3 deletions
... ... @@ -2329,10 +2329,8 @@ int vnc_display_open(DisplayState *ds, const char *display)
2329 2329 end = strchr(options, ',');
2330 2330 if (start && (!end || (start < end))) {
2331 2331 int len = end ? end-(start+1) : strlen(start+1);
2332   - char *path = qemu_malloc(len+1);
  2332 + char *path = qemu_strndup(start + 1, len);
2333 2333  
2334   - pstrcpy(path, len, start + 1);
2335   - path[len] = '\0';
2336 2334 VNC_DEBUG("Trying certificate path '%s'\n", path);
2337 2335 if (vnc_set_x509_credential_dir(vs, path) < 0) {
2338 2336 fprintf(stderr, "Failed to find x509 certificates/keys in %s\n", path);
... ...