« Previous | Next » 

Revision 49aa4058

ID49aa4058ac6dd0081aaa45776f07c98df397ca5e

Added by Stefan Weil over 10 years ago

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 <>
Signed-off-by: Stefan Weil <>
Reviewed-by: Alex Bennée <>
Signed-off-by: Michael Tokarev <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences