Skip to content

Commit 2b07306

Browse files
committed
ECC-1938: BUFR: Dealing with corrupted messages (part 1)
1 parent e213025 commit 2b07306

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/grib_io.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,9 @@ static int read_BUFR(reader* r, int no_alloc)
822822
if (sec3len < 5) {
823823
return GRIB_INVALID_MESSAGE; // ECC-1778
824824
}
825+
if (sec3len > 10'000'000) {
826+
return GRIB_INVALID_MESSAGE; // ECC-1938
827+
}
825828
if ((r->read(r->read_data, tmp + i, sec3len - 3, &err) != sec3len - 3) || err)
826829
return err;
827830
i += sec3len - 3;

0 commit comments

Comments
 (0)