qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/2] Check value for invalid negative values


From: Frediano Ziglio
Subject: [Qemu-devel] [PATCH 2/2] Check value for invalid negative values
Date: Thu, 11 Jun 2015 14:17:57 +0100

In qxl_v2n check that value is not negative.

Signed-off-by: Frediano Ziglio <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]