mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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-
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user