[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 4/8] qapi: Avoid output visitor crashing if it encoun
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 4/8] qapi: Avoid output visitor crashing if it encounters a NULL value |
Date: |
Wed, 28 May 2014 19:28:59 +0200 |
From: Marcel Apfelbaum <address@hidden>
A NULL value is not added to visitor's stack, but there
is no check for that when the visitor tries to return
that value, leading to QEMU crash.
Reviewed-by: Eric Blake <address@hidden>
Acked-by: Luiz Capitulino <address@hidden>
Signed-off-by: Marcel Apfelbaum <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Acked-by: Michael Roth <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
qapi/qmp-output-visitor.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c
index 74a5684..96b3384 100644
--- a/qapi/qmp-output-visitor.c
+++ b/qapi/qmp-output-visitor.c
@@ -66,6 +66,12 @@ static QObject *qmp_output_pop(QmpOutputVisitor *qov)
static QObject *qmp_output_first(QmpOutputVisitor *qov)
{
QStackEntry *e = QTAILQ_LAST(&qov->stack, QStack);
+
+ /* FIXME - find a better way to deal with NULL values */
+ if (!e) {
+ return NULL;
+ }
+
return e->value;
}
--
1.8.4.5
- [Qemu-devel] [PULL 0/8] QOM devices patch queue 2014-05-28, Andreas Färber, 2014/05/28
- [Qemu-devel] [PULL 1/8] qom-test: Test qom-list on link<> properties, Andreas Färber, 2014/05/28
- [Qemu-devel] [PULL 3/8] vl.c: Do not set 'type' property in obj_set_property(), Andreas Färber, 2014/05/28
- [Qemu-devel] [PULL 7/8] qdev: Implement named GPIOs, Andreas Färber, 2014/05/28
- [Qemu-devel] [PULL 4/8] qapi: Avoid output visitor crashing if it encounters a NULL value,
Andreas Färber <=
- [Qemu-devel] [PULL 8/8] ssi: Name the CS GPIO, Andreas Färber, 2014/05/28
- [Qemu-devel] [PULL 6/8] machine: Make -machine opts properties of MachineState, Andreas Färber, 2014/05/28
- [Qemu-devel] [PULL 5/8] tests: Check empty QMP output visitor, Andreas Färber, 2014/05/28
- [Qemu-devel] [PULL 2/8] machine: Conversion of QEMUMachineInitArgs to MachineState, Andreas Färber, 2014/05/28
- Re: [Qemu-devel] [PULL 0/8] QOM devices patch queue 2014-05-28, Peter Maydell, 2014/05/28