diff options
author | Tom Lane | 2005-11-19 02:08:45 +0000 |
---|---|---|
committer | Tom Lane | 2005-11-19 02:08:45 +0000 |
commit | 25c00833cb694bea1c4fb3caeccbc9a1fb72d6f8 (patch) | |
tree | 2c52ed67f3b7826c35e39c0b6ffd34553452a9b1 /contrib/ltree/ltree_gist.c | |
parent | 1e9a1a70adc1f36d9ba8cd67ce974f777df7aafb (diff) |
Add defenses against nulls-in-arrays to contrib/ltree. Possibly it'd
be useful to actually do something with nulls, rather than reject them,
but I'll just close the hole for now.
Diffstat (limited to 'contrib/ltree/ltree_gist.c')
-rw-r--r-- | contrib/ltree/ltree_gist.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c index 2be6449329c..9cdbcde886e 100644 --- a/contrib/ltree/ltree_gist.c +++ b/contrib/ltree/ltree_gist.c @@ -607,6 +607,10 @@ arrq_cons(ltree_gist * key, ArrayType *_query) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), errmsg("array must be one-dimensional"))); + if (ARR_HASNULL(_query)) + ereport(ERROR, + (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), + errmsg("array must not contain nulls"))); while (num > 0) { |