summaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-29 21:28:50 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-29 21:28:50 +0000
commit243e7496c9169138e44403446a300760bf5d750a (patch)
tree8e4eb1007a6f4ad9c2ccda995d145a1dbe0cc2f5 /json.c
parent6b62b101250cacf8e55ca942e545ad00d0656035 (diff)
downloadgpsd-243e7496c9169138e44403446a300760bf5d750a.tar.gz
Prevent some SEGVs on ill-formed comands.
Diffstat (limited to 'json.c')
-rw-r--r--json.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/json.c b/json.c
index 4131c323..afd7954a 100644
--- a/json.c
+++ b/json.c
@@ -96,6 +96,8 @@ static int json_internal_read_object(const char *cp, const struct json_attr_t *a
const struct json_enum_t *mp;
char *lptr;
+ *end = NULL; /* give it a well-defined value on parse failure */
+
/* stuff fields with defaults in case they're omitted in the JSON input */
for (cursor = attrs; cursor->attribute != NULL; cursor++) {
lptr = json_target_address(cursor, parent, offset);