Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
count = qemu_chr_cirmem_count(chr);
size = size > count ? count : size;
- read_data = g_malloc0(size + 1);
+ read_data = g_malloc(size + 1);
cirmem_chr_read(chr, read_data, size);
data = g_base64_encode(read_data, size);
g_free(read_data);
} else {
+ read_data[size] = 0;
data = (char *)read_data;
}