Assert bounds checks on two array reads which rely on data not being out of bounds

pull/3685/head
Philip Dubé 2020-03-31 18:44:34 +00:00
parent bab4cff1c9
commit ddc3377026
1 changed files with 2 additions and 0 deletions

View File

@ -373,6 +373,7 @@ TupleToDistributedResultFragment(TupleTableSlot *tupleSlot,
text *resultId = DatumGetTextP(slot_getattr(tupleSlot, 3, &isNull));
int64 rowCount = DatumGetInt64(slot_getattr(tupleSlot, 4, &isNull));
Assert(targetShardIndex < targetRelation->shardIntervalArrayLength);
ShardInterval *shardInterval =
targetRelation->sortedShardIntervalArray[targetShardIndex];
@ -443,6 +444,7 @@ ColocateFragmentsWithRelation(List *fragmentList, CitusTableCacheEntry *targetRe
{
int shardIndex = sourceFragment->targetShardIndex;
Assert(shardIndex < shardCount);
shardResultIdList[shardIndex] = lappend(shardResultIdList[shardIndex],
sourceFragment->resultId);
}