diff options
| author | Gonglei | 2016-03-03 10:43:42 +0100 |
|---|---|---|
| committer | Paolo Bonzini | 2016-04-08 00:07:56 +0200 |
| commit | 1a5512bb7ef73036a406727397fb58c640074321 (patch) | |
| tree | 38d920e763b37de7a12e6a3d57f271e248d70912 /hw/ppc | |
| parent | nbd: do not hang nbd_wr_syncv if outside a coroutine and no available data (diff) | |
| download | qemu-1a5512bb7ef73036a406727397fb58c640074321.tar.gz qemu-1a5512bb7ef73036a406727397fb58c640074321.tar.xz qemu-1a5512bb7ef73036a406727397fb58c640074321.zip | |
spapr: fix possible Negative array index read
fix CID 1351391.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Message-Id: <1456998223-12356-6-git-send-email-arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ppc')
| -rw-r--r-- | hw/ppc/spapr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e7be21e678..feaab08c3d 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2208,6 +2208,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 |
