Skip to content

Commit

Permalink
[3.13] gh-123229: Fix valgrind warning by initializing the f-string b…
Browse files Browse the repository at this point in the history
…uffers to 0 in the tokenizer (GH-123263) (#123264)

gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer (GH-123263)
(cherry picked from commit adc5190)

Signed-off-by: Pablo Galindo <[email protected]>
Co-authored-by: Pablo Galindo Salgado <[email protected]>
  • Loading branch information
miss-islington and pablogsal authored Aug 23, 2024
1 parent 0955db1 commit 935b8b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix valgrind warning by initializing the f-string buffers to 0 in the
tokenizer. Patch by Pablo Galindo
3 changes: 2 additions & 1 deletion Parser/lexer/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
struct tok_state *
_PyTokenizer_tok_new(void)
{
struct tok_state *tok = (struct tok_state *)PyMem_Malloc(
struct tok_state *tok = (struct tok_state *)PyMem_Calloc(
1,
sizeof(struct tok_state));
if (tok == NULL)
return NULL;
Expand Down

0 comments on commit 935b8b4

Please sign in to comment.