Skip to content

Commit 41b0239

Browse files
committed
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 0785d1b. 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
1 parent 342fb8a commit 41b0239

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/jsonapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ json_lex(JsonLexContext *lex)
15361536
jsonapi_StrValType *ptok = &(lex->inc_state->partial_token);
15371537
size_t added = 0;
15381538
bool tok_done = false;
1539-
JsonLexContext dummy_lex;
1539+
JsonLexContext dummy_lex = {0};
15401540
JsonParseErrorType partial_result;
15411541

15421542
if (ptok->data[0] == '"')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy