qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] spapr: fix write-past-end-of-array error in cpu core device init code
@ 2016-06-27 16:28 Greg Kurz
  2016-06-28  2:55 ` David Gibson
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kurz @ 2016-06-27 16:28 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-devel, qemu-ppc, Alexander Graf, bharata

This fixes a potential QEMU crash introduced by commit 3b542549661.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/ppc/spapr_cpu_core.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 3a5da09b9902..8b802a6fcf0b 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -309,10 +309,9 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)
     }
 
 err:
-    while (i >= 0) {
+    while (--i >= 0) {
         obj = sc->threads + i * size;
         object_unparent(obj);
-        i--;
     }
     g_free(sc->threads);
     error_propagate(errp, local_err);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-28  8:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-27 16:28 [Qemu-devel] [PATCH] spapr: fix write-past-end-of-array error in cpu core device init code Greg Kurz
2016-06-28  2:55 ` David Gibson
2016-06-28  5:24   ` Greg Kurz
2016-06-28  6:24     ` David Gibson
2016-06-28  8:00       ` Bharata B Rao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).