diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-10-17 08:23:46 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-10-17 08:23:46 +0200 |
commit | 41b023946dfd20acbc4f3b14650a032eb46f5216 (patch) | |
tree | 2ca1cdd1c955d4d41d0babe2e372fa7d2fef3fce /src/common/jsonapi.c | |
parent | 342fb8a332007fb64fb1450e28194c36e9da3d6b (diff) | |
download | postgresql-41b023946dfd20acbc4f3b14650a032eb46f5216.tar.gz postgresql-41b023946dfd20acbc4f3b14650a032eb46f5216.zip |
jsonapi: fully initialize dummy lexer
Valgrind reports that checks on lex->inc_state are undefined for the
"dummy lexer" used for incremental parsing, since it's only partially
initialized on the stack. This was introduced in 0785d1b8b2.
Zero-initialize the whole struct.
Author: Jacob Champion <jacob.champion@enterprisedb.com>
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAOYmi+n9QWr4gsAADZc6qFQjFViXQYVk=gBy_EvxuqsgPJcb_g@mail.gmail.com
Diffstat (limited to 'src/common/jsonapi.c')
-rw-r--r-- | src/common/jsonapi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/jsonapi.c b/src/common/jsonapi.c index 45838d8a184..ca4ecd571ef 100644 --- a/src/common/jsonapi.c +++ b/src/common/jsonapi.c @@ -1536,7 +1536,7 @@ json_lex(JsonLexContext *lex) jsonapi_StrValType *ptok = &(lex->inc_state->partial_token); size_t added = 0; bool tok_done = false; - JsonLexContext dummy_lex; + JsonLexContext dummy_lex = {0}; JsonParseErrorType partial_result; if (ptok->data[0] == '"') |