qemu-trivial
[Top][All Lists]
Advanced

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

[Qemu-trivial] [PATCH 5/6] spapr: fix possible Negative array index read


From: Gonglei
Subject: [Qemu-trivial] [PATCH 5/6] spapr: fix possible Negative array index read
Date: Thu, 3 Mar 2016 17:43:42 +0800

fix CID 1351391.

Signed-off-by: Gonglei <address@hidden>
---
 hw/ppc/spapr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index e9d4abf..57d19ab 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2221,6 +2221,10 @@ static void spapr_machine_device_plug(HotplugHandler 
*hotplug_dev,
         if (*errp) {
             return;
         }
+        if (node < 0 || node >= MAX_NODES) {
+            error_setg(errp, "Invaild node %d", node);
+            return;
+        }
 
         /*
          * Currently PowerPC kernel doesn't allow hot-adding memory to
-- 
1.8.5.2





reply via email to

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