aboutsummaryrefslogtreecommitdiff
path: root/contrib/intarray/_int_bool.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-11-19 03:00:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-11-19 03:00:09 +0000
commit8ef289dba12f16f3692c235863a887672499a5d9 (patch)
tree819abde06463716dbbf505c444a69ec6858efe6a /contrib/intarray/_int_bool.c
parent25c00833cb694bea1c4fb3caeccbc9a1fb72d6f8 (diff)
downloadpostgresql-8ef289dba12f16f3692c235863a887672499a5d9.tar.gz
postgresql-8ef289dba12f16f3692c235863a887672499a5d9.zip
Defend against nulls-in-arrays in contrib/intarray. I may have put in
more tests than strictly necessary, but did not feel like tracing call paths in detail ...
Diffstat (limited to 'contrib/intarray/_int_bool.c')
-rw-r--r--contrib/intarray/_int_bool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c
index 824dc5b6775..8e0b913c013 100644
--- a/contrib/intarray/_int_bool.c
+++ b/contrib/intarray/_int_bool.c
@@ -309,6 +309,7 @@ execconsistent(QUERYTYPE * query, ArrayType *array, bool calcnot)
{
CHKVAL chkval;
+ CHECKARRVALID(array);
chkval.arrb = ARRPTR(array);
chkval.arre = chkval.arrb + ARRNELEMS(array);
return execute(
@@ -339,6 +340,7 @@ boolop(PG_FUNCTION_ARGS)
CHKVAL chkval;
bool result;
+ CHECKARRVALID(val);
if (ARRISVOID(val))
{
pfree(val);