diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-03-27 15:57:29 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-03-27 15:57:29 -0400 |
commit | c21f0d0f6b76d49501050a5e44778d06b7bcaad3 (patch) | |
tree | c61f3afe260518ccc3531eb341fcfb03d0e9ff33 /libgps_core.c | |
parent | 5cda32d66428e0e794dc66226a36f3c00cbcbd9e (diff) | |
download | gpsd-c21f0d0f6b76d49501050a5e44778d06b7bcaad3.tar.gz |
Cope gracefully with failed read of JSON object. Suggested by Don Weeks.
Diffstat (limited to 'libgps_core.c')
-rw-r--r-- | libgps_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libgps_core.c b/libgps_core.c index 37ae225a..41f8b918 100644 --- a/libgps_core.c +++ b/libgps_core.c @@ -241,7 +241,8 @@ int gps_unpack(char *buf, struct gps_data_t *gpsdata) libgps_debug_trace((1, "gps_unpack() segment parse '%s'\n", *next)); - (void)libgps_json_unpack(*next, gpsdata, next); + if (libgps_json_unpack(*next, gpsdata, next) == -1) + break; #ifdef LIBGPS_DEBUG if (debuglevel >= 1) libgps_dump_state(gpsdata, time(NULL)); |