From f01c5eae2a3d6efebe9332a8654303356e622bec Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Sep 2013 17:48:20 +0100 Subject: [PATCH] intel-virtual-output: Reserve space for the '\0' in the sprintf Even though we don't use the trailing NUL byte for our comparisons, sprintf will write it, so we need make space for it. Reported-by: Severin Strobl Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68987 Signed-off-by: Chris Wilson --- tools/virtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtual.c b/tools/virtual.c index 8e241e53..41bc36e5 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -2041,7 +2041,7 @@ static int first_display_wait_for_ack(struct context *ctx, int timeout, int id) { struct display *display = ctx->display; struct pollfd pfd; - char expect[5]; + char expect[6]; /* "1234R\0" */ sprintf(expect, "%04xR", id); DBG(("%s: wait for act '%c%c%c%c%c'\n",