Fix server_id overflow due to utf8 blowup in json.

This commit is contained in:
Ian Gulliver
2016-02-26 20:58:23 -08:00
parent d6cb3afd9d
commit 7d83d122df
4 changed files with 31 additions and 1 deletions

View File

@@ -99,6 +99,10 @@ static bool json_parse_header(json_t *in, struct packet *packet, struct json_par
state->mlat_timestamp_max = (uint64_t) mlat_timestamp_max;
state->rssi_max = (uint32_t) rssi_max;
if (!packet_validate_id((const uint8_t *) json_server_id)) {
return false;
}
if (!strcmp(json_server_id, (const char *) server_id)) {
fprintf(stderr, "R %s: Attempt to receive json data from our own server ID (%s); loop!\n", packet->source_id, server_id);
return false;