summaryrefslogtreecommitdiff
path: root/contrib/ltree/ltxtquery_io.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2016-03-08 14:59:29 -0800
committerAndres Freund <andres@anarazel.de>2016-03-08 14:59:29 -0800
commit814570418d5e6bccb766efbe86d27aef206e5511 (patch)
tree5d3ddc0bcc82f3eda90d359f140abbd89ef4d47a /contrib/ltree/ltxtquery_io.c
parentc5f1fbbfb51d852f0e9a1143dae9faa5186c1b2d (diff)
ltree: Zero padding bytes when allocating memory for externally visible data.
ltree/ltree_gist/ltxtquery's headers stores data at MAXALIGN alignment, requiring some padding bytes. So far we left these uninitialized. Zero those by using palloc0. Author: Andres Freund Reported-By: Andres Freund / valgrind / buildarm animal skink Backpatch: 9.1-
Diffstat (limited to 'contrib/ltree/ltxtquery_io.c')
-rw-r--r--contrib/ltree/ltxtquery_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/ltree/ltxtquery_io.c b/contrib/ltree/ltxtquery_io.c
index d0e4b7f7e22..e2d468ac1b2 100644
--- a/contrib/ltree/ltxtquery_io.c
+++ b/contrib/ltree/ltxtquery_io.c
@@ -354,7 +354,7 @@ queryin(char *buf)
errmsg("ltxtquery is too large")));
commonlen = COMPUTESIZE(state.num, state.sumlen);
- query = (ltxtquery *) palloc(commonlen);
+ query = (ltxtquery *) palloc0(commonlen);
SET_VARSIZE(query, commonlen);
query->size = state.num;
ptr = GETQUERY(query);