diff --git a/d868uv.c b/d868uv.c index ba61fdf..8f3ecc5 100644 --- a/d868uv.c +++ b/d868uv.c @@ -2863,8 +2863,9 @@ static void d868uv_write_csv(radio_device_t *radio, FILE *csv) // Add map record. if (sz.count >= NCALLSIGNS) { - fprintf(stderr, "Too many contacts!\n"); - return; + fprintf(stderr, "WARNING: Too many callsigns!\n"); + fprintf(stderr, "Skipping the rest.\n"); + break; } callsign_map_t *m = &map[sz.count]; sz.count++; diff --git a/uv380.c b/uv380.c index 3b3cee5..3e5fe29 100644 --- a/uv380.c +++ b/uv380.c @@ -2454,6 +2454,11 @@ static void uv380_write_csv(radio_device_t *radio, FILE *csv) } cs = GET_CALLSIGN(mem, nrecords); + if ((uint8_t*) (cs + 1) > &mem[nbytes]) { + fprintf(stderr, "WARNING: Too many callsigns!\n"); + fprintf(stderr, "Skipping the rest.\n"); + break; + } nrecords++; // Fill callsign structure.