Skip to content

Commit

Permalink
Merge pull request #366 from diffix/piotr/minor-tweaks
Browse files Browse the repository at this point in the history
Protect against find_agg_funcs(0) on uninitialized oid cache
  • Loading branch information
pdobacz authored May 31, 2022
2 parents feb5ad7 + 30ef143 commit 2b2ead4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/aggregation/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ PG_FUNCTION_INFO_V1(anon_agg_state_finalfn);

const AnonAggFuncs *find_agg_funcs(Oid oid)
{
Assert(OidIsValid(oid));

if (oid == g_oid_cache.anon_count_star)
if (!OidIsValid(oid))
return NULL;
else if (oid == g_oid_cache.anon_count_star)
return &g_count_star_funcs;
else if (oid == g_oid_cache.anon_count_value)
return &g_count_value_funcs;
Expand Down

0 comments on commit 2b2ead4

Please sign in to comment.