« Previous | Next » 

Revision 82e59a67

ID82e59a676c01b3df3b53998d428d0a64a55f2439

Added by Markus Armbruster over 11 years ago

qmp: Fix design bug and read beyond buffer in memchar-write

Command memchar-write takes data and size parameter. Begs the
question what happens when data doesn't match size.

With format base64, qmp_memchar_write() copies the full data argument,
regardless of size argument.

With format utf8, qmp_memchar_write() copies size bytes from data,
happily reading beyond data. Copies crap from the heap or even
crashes.

Drop the size parameter, and always copy the full data argument.

Signed-off-by: Markus Armbruster <>
Reviewed-by: Eric Blake <>
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences