[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC][PATCH v2 03/17] json-parser: add handling for NULL to
From: |
Michael Roth |
Subject: |
[Qemu-devel] [RFC][PATCH v2 03/17] json-parser: add handling for NULL token list |
Date: |
Mon, 18 Apr 2011 10:02:19 -0500 |
Currently a NULL token list will crash the parser, instead we have it
pass back a NULL QObject.
Signed-off-by: Michael Roth <address@hidden>
---
json-parser.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/json-parser.c b/json-parser.c
index 58e973b..849e215 100644
--- a/json-parser.c
+++ b/json-parser.c
@@ -633,9 +633,13 @@ QObject *json_parser_parse(QList *tokens, va_list *ap)
QObject *json_parser_parse_err(QList *tokens, va_list *ap, Error **errp)
{
JSONParserContext ctxt = {};
- QList *working = qlist_copy(tokens);
+ QList *working;
QObject *result;
+ if (!tokens) {
+ return NULL;
+ }
+ working = qlist_copy(tokens);
result = parse_value(&ctxt, &working, ap);
QDECREF(working);
--
1.7.0.4
- Re: [Qemu-devel] [RFC][PATCH v2 09/17] qmp proxy: core code for proxying qmp requests to guest, (continued)
- [Qemu-devel] [RFC][PATCH v2 10/17] qmp proxy: add qmp_proxy chardev, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 06/17] qapi: fix memory leak for async marshalling code, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 07/17] qapi: qmp-gen.py, use basename of path for guard/core prefix, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 02/17] json-streamer: add handling for JSON_ERROR token/state, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 01/17] json-lexer: make lexer error-recovery more deterministic, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 05/17] qapi: fix handling for null-return async callbacks, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 03/17] json-parser: add handling for NULL token list,
Michael Roth <=
- [Qemu-devel] [RFC][PATCH v2 08/17] qapi: fix Error usage in qemu-sockets.c, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 12/17] guest agent: worker thread class, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 16/17] guest agent: add guest agent RPCs/commands, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon, Michael Roth, 2011/04/18