diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-29 21:28:50 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-29 21:28:50 +0000 |
commit | 243e7496c9169138e44403446a300760bf5d750a (patch) | |
tree | 8e4eb1007a6f4ad9c2ccda995d145a1dbe0cc2f5 /json.c | |
parent | 6b62b101250cacf8e55ca942e545ad00d0656035 (diff) | |
download | gpsd-243e7496c9169138e44403446a300760bf5d750a.tar.gz |
Prevent some SEGVs on ill-formed comands.
Diffstat (limited to 'json.c')
-rw-r--r-- | json.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |