]> git.ipfire.org Git - thirdparty/qemu.git/commit
qemu-char: Fix potential out of bounds access to local arrays
authorStefan Weil <sw@weilnetz.de>
Mon, 30 Sep 2013 21:04:49 +0000 (23:04 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 3 Dec 2013 03:43:54 +0000 (21:43 -0600)
commit78bd79fac33a56156d1d05a7f0547a0b7c282225
tree7b5f15da376222a1024e0dd6c42fdf1634af93f8
parenta2c9dc504a28d07284d87a4ef10ad66f6f864b42
qemu-char: Fix potential out of bounds access to local arrays

Latest gcc-4.8 supports a new option -fsanitize=address which activates
an AddressSanitizer. This AddressSanitizer stops the QEMU system emulation
very early because two character arrays of size 8 are potentially written
with 9 bytes.

Commit 6ea314d91439741e95772dfbab98b4135e04bebb added the code.

There is no obvious reason why width or height could need 8 characters,
so reduce it to 7 characters which together with the terminating '\0'
fit into the arrays.

Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Alex Bennée <alex@bennee.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 49aa4058ac6dd0081aaa45776f07c98df397ca5e)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qemu-char.c