mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl: Do not generate short block in libxl__datacopier_prefixdata
libxl__datacopier_prefixdata would prepend a deliberately short block (not just a half-full one, but one with a short buffer) to the dc->bufs queue. However, this is wrong because datacopier_readable will find it and try to continue to fill it up. Instead, allocate a full-sized buffer. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Tested-by: Chunyan Liu <cyliu@suse.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
1581630f96
commit
f6d2a87f05
1 file changed
+1
-1
@@ -89,7 +89,7 @@ void libxl__datacopier_prefixdata(libxl__egc *egc, libxl__datacopier_state *dc,
|
||||
|
||||
assert(len < dc->maxsz - dc->used);
|
||||
|
||||
buf = libxl__zalloc(NOGC, sizeof(*buf) - sizeof(buf->buf) + len);
|
||||
buf = libxl__zalloc(NOGC, sizeof(*buf));
|
||||
buf->used = len;
|
||||
memcpy(buf->buf, data, len);
|
||||
|
||||
|
||||