Fix underflow initialization of default values

Initialization of queryWindowClause and queryOrderByLimit "memset" underflow these variables.
It's possible due to the invalid usage sizeof this part of the program cause buffer overflow and function return data corruption in future changes.
pull/3225/head
Khashayar Fereidani 2019-11-25 22:12:04 +03:30 committed by Philip Dubé
parent bef32624c3
commit f81785ad14
1 changed files with 4 additions and 4 deletions

View File

@ -2078,11 +2078,11 @@ WorkerExtendedOpNode(MultiExtendedOp *originalOpNode,
bool queryHasAggregates = TargetListHasAggragates(originalTargetEntryList);
/* initialize to default values */
memset(&queryTargetList, 0, sizeof(queryGroupClause));
memset(&queryTargetList, 0, sizeof(queryTargetList));
memset(&queryGroupClause, 0, sizeof(queryGroupClause));
memset(&queryDistinctClause, 0, sizeof(queryGroupClause));
memset(&queryWindowClause, 0, sizeof(queryGroupClause));
memset(&queryOrderByLimit, 0, sizeof(queryGroupClause));
memset(&queryDistinctClause, 0, sizeof(queryDistinctClause));
memset(&queryWindowClause, 0, sizeof(queryWindowClause));
memset(&queryOrderByLimit, 0, sizeof(queryOrderByLimit));
/* calculate the next sort group index based on the original target list */
Index nextSortGroupRefIndex = GetNextSortGroupRef(originalTargetEntryList);