mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
When reading the console, xen overwrites the contents of the buffer, so there is no need to zero the buffer before passing it to xen. Instead, add a NULL at the end of the buffer. While we are at it, change the zalloc() of the buffer back to malloc() as it was before bdf4131 (libxl: don't leak buf in libxl_xen_console_read_start error handling, 2013-12-03). The comment in that commit message says that the intent of the commit was to change malloc+memset to zalloc(), but only for the libxl_xen_console_reader struct, not for the buffer. Signed-off-by: Javi Merino <javi.merino@cloud.com> Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>