aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/common/heaptuple.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2018-04-13 16:43:33 -0400
committerAndrew Dunstan <andrew@dunslane.net>2018-04-13 16:43:33 -0400
commit7c44c46deb495a2f3861f402d7f2109263e3d50a (patch)
tree2de4f5483b2366a69050fffbd0a9e5bacf29c15c /src/backend/access/common/heaptuple.c
parent8bf358c18ec930ddfb998873369e2fc38608d3e1 (diff)
downloadpostgresql-7c44c46deb495a2f3861f402d7f2109263e3d50a.tar.gz
postgresql-7c44c46deb495a2f3861f402d7f2109263e3d50a.zip
Prevent segfault in expand_tuple with no missing values
Commit 16828d5c forgot to check that it had a set of missing values before trying to retrieve a value from it. An additional query to add coverage for this code is added to the regression test. Per bug report from Andreas Seltenreich.
Diffstat (limited to 'src/backend/access/common/heaptuple.c')
-rw-r--r--src/backend/access/common/heaptuple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index c64645675e6..b9802b92c0b 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -981,7 +981,7 @@ expand_tuple(HeapTuple *targetHeapTuple,
Form_pg_attribute attr = TupleDescAttr(tupleDesc, attnum);
- if (attrmiss[attnum].ammissingPresent)
+ if (attrmiss && attrmiss[attnum].ammissingPresent)
{
fill_val(attr,
nullBits ? &nullBits : NULL,