From 83aa16929ed1e60fabe1bda4824e7c4942ff42ec Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 4 Mar 2011 09:10:40 -0500 Subject: [PATCH] Fix off-by-one in open_memstream size returned by open_memstream does not include the final \0. We have to add 1 to the size of the message sent. Signed-off-by: Mathieu Desnoyers --- libust/tracectl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libust/tracectl.c b/libust/tracectl.c index b058cb3..0cff6fd 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -957,7 +957,7 @@ static void process_client_cmd(struct ustcomm_header *recv_header, print_markers(fp); fclose(fp); - reply_header->size = size; + reply_header->size = size + 1; /* Include final \0 */ result = ustcomm_send(sock, reply_header, ptr); @@ -983,7 +983,7 @@ static void process_client_cmd(struct ustcomm_header *recv_header, print_trace_events(fp); fclose(fp); - reply_header->size = size; + reply_header->size = size + 1; /* Include final \0 */ result = ustcomm_send(sock, reply_header, ptr); -- 2.34.1