mirror of https://github.com/ecmwf/eccodes.git
ECC-1938: BUFR: Dealing with corrupted messages (part 1)
This commit is contained in:
parent
e213025b62
commit
2b0730694c
|
@ -822,6 +822,9 @@ static int read_BUFR(reader* r, int no_alloc)
|
||||||
if (sec3len < 5) {
|
if (sec3len < 5) {
|
||||||
return GRIB_INVALID_MESSAGE; // ECC-1778
|
return GRIB_INVALID_MESSAGE; // ECC-1778
|
||||||
}
|
}
|
||||||
|
if (sec3len > 10'000'000) {
|
||||||
|
return GRIB_INVALID_MESSAGE; // ECC-1938
|
||||||
|
}
|
||||||
if ((r->read(r->read_data, tmp + i, sec3len - 3, &err) != sec3len - 3) || err)
|
if ((r->read(r->read_data, tmp + i, sec3len - 3, &err) != sec3len - 3) || err)
|
||||||
return err;
|
return err;
|
||||||
i += sec3len - 3;
|
i += sec3len - 3;
|
||||||
|
|
Loading…
Reference in New Issue