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 /gpsd.c | |
parent | 6b62b101250cacf8e55ca942e545ad00d0656035 (diff) | |
download | gpsd-243e7496c9169138e44403446a300760bf5d750a.tar.gz |
Prevent some SEGVs on ill-formed comands.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1645,7 +1645,7 @@ static void handle_newstyle_request(struct subscriber_t *sub, int status; status = json_watch_read(buf+1, &sub->policy, &end); if (status == 0) { - if (*end == ';') + if (*end != NULL && *end == ';') ++end; if (sub->policy.watcher) for(devp = devices; devp < devices + MAXDEVICES; devp++) @@ -1683,7 +1683,7 @@ static void handle_newstyle_request(struct subscriber_t *sub, if (*buf == '=') { int status; status = json_device_read(buf+1, &devconf, &end); - if (*end == ';') + if (end != NULL && *end == ';') ++end; if (status != 0) (void)snprintf(reply, replylen, |