int client_blue_shift, client_blue_max, server_blue_shift, server_blue_max;
CaptureVoiceOut *audio_cap;
- audsettings_t as;
+ struct audsettings as;
VncReadEvent *read_handler;
size_t read_handler_expect;
void do_info_vnc(void)
{
- if (vnc_state == NULL)
+ if (vnc_state == NULL || vnc_state->display == NULL)
term_printf("VNC server disabled\n");
else {
term_printf("VNC server active on: ");
if (len == 1)
return 4;
- if (len == 4)
- return 4 + (read_u16(data, 2) * 4);
+ if (len == 4) {
+ limit = read_u16(data, 2);
+ if (limit > 0)
+ return 4 + (limit * 4);
+ } else
+ limit = read_u16(data, 2);
- limit = read_u16(data, 2);
for (i = 0; i < limit; i++) {
int32_t val = read_s32(data, 4 + (i * 4));
memcpy(data + 4 + (i * 4), &val, sizeof(val));
vs->has_hextile = 0;
vs->ds->dpy_copy = NULL;
vnc_update_client(vs);
+ reset_keys(vs);
}
static void vnc_listen_read(void *opaque)
char *dpy;
dpy = qemu_malloc(256);
if (strncmp(display, "unix:", 5) == 0) {
- strcpy(dpy, "unix:");
- vs->lsock = unix_listen(display, dpy+5, 256-5);
+ pstrcpy(dpy, 256, "unix:");
+ vs->lsock = unix_listen(display+5, dpy+5, 256-5);
} else {
vs->lsock = inet_listen(display, dpy, 256, SOCK_STREAM, 5900);
}