libxl_qmp: fix qmp_next
PATCH 1/1 libxl_qmp: fix qmp_next
qmp_next doesn't handle multiple lines read together in a single buffer correctly at the moment.
This patch fixes it.
Signed-off-by Stefano Stabellini <[email protected]>
--- tools/libxl/libxl_qmp.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
tools/libxl/libxl_qmp.c +4 -3
@@ -412,17 +412,18 @@ do_select_again:char *end =NULL ;if (incomplete) {size_t current_pos = s - incomplete; - incomplete_size += rd; incomplete =libxl__realloc (gc, incomplete, - incomplete_size +1 ); - incomplete =strncat (incomplete, qmp->buffer, rd); + incomplete_size + rd); +strncat (incomplete + incomplete_size, qmp->buffer, rd); s = incomplete + current_pos; + incomplete_size += rd; s_end = incomplete + incomplete_size; }else { incomplete =libxl__strndup (gc, qmp->buffer, rd); incomplete_size = rd; s = incomplete; s_end = s + rd; + rd =0 ; } end =strstr (s,"\r\n" );
Signature · 1 line
1.7.2.5
Stefano Stabellini writes ("[Xen-devel] [PATCH] libxl_qmp: fix qmp_next"):
Quoted 3 lines
qmp_nextdoesn't handle multiple lines read together in a single buffer correctly at the moment.
This patch fixes it.
Committed-by Ian Jackson <[email protected]>