Fix integer overflow in setListPointer size calculation

This commit is contained in:
Martin Dindoffer 2022-05-06 15:01:12 +02:00 committed by Vaci
parent b1eadaee6c
commit 529a3daa6f

View file

@ -1035,7 +1035,7 @@ final class WireHelpers {
};
static SegmentBuilder setListPointer(SegmentBuilder segment, CapTableBuilder capTable, int refOffset, ListReader value) {
int totalSize = roundBitsUpToWords(value.elementCount * value.step);
int totalSize = roundBitsUpToWords((long) value.elementCount * value.step);
if (value.step <= Constants.BITS_PER_WORD) {
//# List of non-structs.