qemu-irix/ui
Michael Tokarev f8a4bf59fe vnc: tight: Fix crash after 2GB of output
fix 2Gb integer overflow in in VNC tight and zlib encodings

As found by Roland Dreier <roland@purestorage.com> (excellent
catch!), when amount of VNC compressed data produced by zlib
and sent to client exceeds 2Gb, integer overflow occurs because
currently, we calculate amount of data produced at each step by
comparing saved total_out with new total_out, and total_out is
something which grows without bounds.  Compare it with previous
avail_out instead of total_out, and leave total_out alone.

The same code is used in vnc-enc-tight.c and vnc-enc-zlib.c,
so fix both cases.

There, there's no actual need to save previous_out value, since
capacity-offset (which is how that value is calculated) stays
the same so it can be recalculated again after call to deflate(),
but whole thing becomes less readable this way.

Reported-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-10 00:23:52 +02:00
..
cocoa.m Delete useless 'extern' qualifiers for functions 2011-01-23 16:21:20 +00:00
curses.c curses: Fix control-{@[\]^_} and ESC 2010-10-21 18:31:28 +02:00
curses_keys.h curses: Fix control-{@[\]^_} and ESC 2010-10-21 18:31:28 +02:00
d3des.c
d3des.h Delete useless 'extern' qualifiers for functions 2011-01-23 16:21:20 +00:00
keymaps.c
keymaps.h
qemu-spice.h spice: add chardev (v5) 2011-01-24 15:41:40 +01:00
sdl.c ui/sdl: Fix handling of caps lock and num lock keys 2011-02-04 06:53:52 -06:00
sdl_keysym.h
sdl_zoom.c
sdl_zoom.h
sdl_zoom_template.h
spice-core.c spice/vnc: client migration. 2011-01-24 15:13:54 +01:00
spice-display.c spice-display: replace private lock with qemu mutex. 2010-11-02 12:43:04 +01:00
spice-display.h spice-display: replace private lock with qemu mutex. 2010-11-02 12:43:04 +01:00
spice-input.c spice: add tablet support 2010-09-21 18:36:43 +02:00
vnc-auth-sasl.c vnc-auth-sasl: fix a memory leak 2011-01-12 19:48:56 +00:00
vnc-auth-sasl.h
vnc-auth-vencrypt.c
vnc-auth-vencrypt.h
vnc-enc-hextile-template.h
vnc-enc-hextile.c vnc: encapsulate encoding members 2010-07-26 17:36:14 -05:00
vnc-enc-tight.c vnc: tight: Fix crash after 2GB of output 2011-04-10 00:23:52 +02:00
vnc-enc-tight.h vnc: tight add PNG encoding 2010-07-26 17:36:14 -05:00
vnc-enc-zlib.c vnc: tight: Fix crash after 2GB of output 2011-04-10 00:23:52 +02:00
vnc-jobs-async.c vnc: qemu can die if the client is disconnected while updating screen 2011-02-04 06:53:52 -06:00
vnc-jobs-sync.c vnc: threaded VNC server 2010-07-26 17:36:14 -05:00
vnc-jobs.h vnc: threaded VNC server 2010-07-26 17:36:14 -05:00
vnc-palette.c vnc: tight: stop using qdict for palette stuff 2010-07-26 17:36:14 -05:00
vnc-palette.h vnc: tight: stop using qdict for palette stuff 2010-07-26 17:36:14 -05:00
vnc-tls.c
vnc-tls.h
vnc.c vnc: Fix fatal crash with vnc reverse mode 2011-02-25 10:17:07 -06:00
vnc.h vnc: support password expire 2010-12-09 14:23:24 +01:00
vnc_keysym.h
x_keymap.c
x_keymap.h Delete useless 'extern' qualifiers for functions 2011-01-23 16:21:20 +00:00