mirror of
https://github.com/zebrajr/postgres.git
synced 2025-12-07 00:20:24 +01:00
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
This commit is contained in:
parent
342fb8a332
commit
41b023946d
|
|
@ -1536,7 +1536,7 @@ json_lex(JsonLexContext *lex)
|
||||||
jsonapi_StrValType *ptok = &(lex->inc_state->partial_token);
|
jsonapi_StrValType *ptok = &(lex->inc_state->partial_token);
|
||||||
size_t added = 0;
|
size_t added = 0;
|
||||||
bool tok_done = false;
|
bool tok_done = false;
|
||||||
JsonLexContext dummy_lex;
|
JsonLexContext dummy_lex = {0};
|
||||||
JsonParseErrorType partial_result;
|
JsonParseErrorType partial_result;
|
||||||
|
|
||||||
if (ptok->data[0] == '"')
|
if (ptok->data[0] == '"')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user