From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z32N2-0000x6-H5 for qemu-devel@nongnu.org; Thu, 11 Jun 2015 09:18:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z32My-0005Yg-UH for qemu-devel@nongnu.org; Thu, 11 Jun 2015 09:18:12 -0400 From: Frediano Ziglio Date: Thu, 11 Jun 2015 14:17:57 +0100 Message-Id: <1434028677-26160-2-git-send-email-fziglio@redhat.com> In-Reply-To: <1434028677-26160-1-git-send-email-fziglio@redhat.com> References: <1434028677-26160-1-git-send-email-fziglio@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] Check value for invalid negative values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fziglio@redhat.com, Gerd Hoffmann Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org In qxl_v2n check that value is not negative. Signed-off-by: Frediano Ziglio --- hw/display/qxl-logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/qxl-logger.c b/hw/display/qxl-logger.c index d944d3f..faed869 100644 --- a/hw/display/qxl-logger.c +++ b/hw/display/qxl-logger.c @@ -93,7 +93,7 @@ static const char *const spice_cursor_type[] = { static const char *qxl_v2n(const char *const n[], size_t l, int v) { - if (v >= l || !n[v]) { + if (v < 0 || v >= l || !n[v]) { return "???"; } return n[v]; -- 2.1.0