Semmle: Actively check one possible NULL deref case (#3560)

Calling ErrorIfUnsupportedConstraint was still giving errors on Semmle. This
makes sure that we check for NULL at runtime. This way we can safely ignore all
errors created by this function.
pull/3600/head
Jelte Fennema 2020-03-11 18:11:56 +01:00 committed by GitHub
parent 468319e638
commit e0bbe1ca38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -880,7 +880,11 @@ ErrorIfUnsupportedConstraint(Relation relation, char distributionMethod,
return;
}
Assert(distributionColumn != NULL);
if (distributionColumn == NULL)
{
ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
errmsg("distribution column of distributed table is NULL")));
}
char *relationName = RelationGetRelationName(relation);
List *indexOidList = RelationGetIndexList(relation);