Skip to content

Commit 2b2ead4

Browse files
authored
Merge pull request #366 from diffix/piotr/minor-tweaks
Protect against find_agg_funcs(0) on uninitialized oid cache
2 parents feb5ad7 + 30ef143 commit 2b2ead4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/aggregation/common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ PG_FUNCTION_INFO_V1(anon_agg_state_finalfn);
2222

2323
const AnonAggFuncs *find_agg_funcs(Oid oid)
2424
{
25-
Assert(OidIsValid(oid));
26-
27-
if (oid == g_oid_cache.anon_count_star)
25+
if (!OidIsValid(oid))
26+
return NULL;
27+
else if (oid == g_oid_cache.anon_count_star)
2828
return &g_count_star_funcs;
2929
else if (oid == g_oid_cache.anon_count_value)
3030
return &g_count_value_funcs;

0 commit comments

Comments
 (0)