Fix #37: crash when updating a callsign database on MD-2017, and it does not fit.
This commit is contained in:
parent
8bc1dde781
commit
511ed5cfe3
5
d868uv.c
5
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++;
|
||||
|
5
uv380.c
5
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.
|
||||
|
Loading…
Reference in New Issue
Block a user