eb8934b041
The _cmp_bytes variable added by commit "bea60dd ui/vnc: fix potential memory corruption issues" can become negative. Result is (possibly exploitable) memory corruption. Reason for that is it uses the stride instead of bytes per scanline to apply limits. For the server surface is is actually fine. vnc creates that itself, there is never any padding and thus scanline length always equals stride. For the guest surface scanline length and stride are typically identical too, but it doesn't has to be that way. So add and use a new variable (guest_ll) for the guest scanline length. Also rename min_stride to line_bytes to make more clear what it actually is. Finally sprinkle in an assert() to make sure we never use a negative _cmp_bytes again. Reported-by: 范祚至(库特) <zuozhi.fzz@alibaba-inc.com> Reviewed-by: P J P <ppandit@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> |
||
---|---|---|
.. | ||
shader | ||
cocoa.m | ||
console-gl.c | ||
console.c | ||
curses_keys.h | ||
curses.c | ||
cursor_hidden.xpm | ||
cursor_left_ptr.xpm | ||
cursor.c | ||
egl-helpers.c | ||
gtk-egl.c | ||
gtk.c | ||
input-keymap.c | ||
input-legacy.c | ||
input.c | ||
keymaps.c | ||
keymaps.h | ||
Makefile.objs | ||
qemu-pixman.c | ||
qemu-x509.h | ||
sdl2-2d.c | ||
sdl2-gl.c | ||
sdl2-input.c | ||
sdl2-keymap.h | ||
sdl2.c | ||
sdl_keysym.h | ||
sdl_zoom_template.h | ||
sdl_zoom.c | ||
sdl_zoom.h | ||
sdl.c | ||
shader.c | ||
spice-core.c | ||
spice-display.c | ||
spice-input.c | ||
vgafont.h | ||
vnc_keysym.h | ||
vnc-auth-sasl.c | ||
vnc-auth-sasl.h | ||
vnc-auth-vencrypt.c | ||
vnc-auth-vencrypt.h | ||
vnc-enc-hextile-template.h | ||
vnc-enc-hextile.c | ||
vnc-enc-tight.c | ||
vnc-enc-tight.h | ||
vnc-enc-zlib.c | ||
vnc-enc-zrle-template.c | ||
vnc-enc-zrle.c | ||
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-tls.c | ||
vnc-tls.h | ||
vnc-ws.c | ||
vnc-ws.h | ||
vnc.c | ||
vnc.h | ||
x_keymap.c | ||
x_keymap.h |