qemu/ui
Paolo Bonzini 3f9c41c5df vnc: avoid underflow when accessing user-provided address
If hostlen is zero, there is a possibility that addrstr[hostlen - 1]
underflows and, if a closing bracked is there, hostlen - 2 is passed
to g_strndup() on the next line.  If websocket==false then
addrstr[0] would be a colon, but if websocket==true this could in
principle happen.

Fix it by checking hostlen.

Reported by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-04-20 11:17:35 +02:00
..
icons
keycodemapdb@f5772a62ec
shader
clipboard.c
cocoa.m
console-gl.c
console.c
curses.c
curses_keys.h
cursor.c
cursor_hidden.xpm
cursor_left_ptr.xpm
dbus-chardev.c
dbus-clipboard.c
dbus-console.c
dbus-display1.xml
dbus-error.c
dbus-listener.c
dbus-module.c
dbus.c
dbus.h
egl-context.c
egl-headless.c
egl-helpers.c
gtk-clipboard.c
gtk-egl.c
gtk-gl-area.c
gtk.c
input-barrier.c
input-barrier.h
input-keymap.c
input-legacy.c
input-linux.c
input.c
kbd-state.c
keymaps.c
keymaps.h
meson.build
qemu-pixman.c
qemu-x509.h
qemu.desktop
sdl2-2d.c
sdl2-gl.c
sdl2-input.c
sdl2.c
shader.c
spice-app.c
spice-core.c
spice-display.c
spice-input.c
spice-module.c
trace-events
trace.h
udmabuf.c
ui-hmp-cmds.c
ui-qmp-cmds.c
util.c
vdagent.c
vgafont.h
vnc-auth-sasl.c
vnc-auth-sasl.h
vnc-auth-vencrypt.c
vnc-auth-vencrypt.h
vnc-clipboard.c
vnc-enc-hextile-template.h
vnc-enc-hextile.c
vnc-enc-tight.c
vnc-enc-tight.h
vnc-enc-zlib.c
vnc-enc-zrle.c
vnc-enc-zrle.c.inc
vnc-enc-zrle.h
vnc-enc-zywrle-template.c
vnc-enc-zywrle.h
vnc-jobs.c
vnc-jobs.h
vnc-palette.c
vnc-palette.h
vnc-stubs.c
vnc-ws.c
vnc-ws.h
vnc.c vnc: avoid underflow when accessing user-provided address 2023-04-20 11:17:35 +02:00
vnc.h
vnc_keysym.h
win32-kbd-hook.c
x_keymap.c
x_keymap.h