Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit adc5190

Browse filesBrowse files
authored
gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer (#123263)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
1 parent 0b0f7be commit adc5190
Copy full SHA for adc5190

2 files changed

+4-1Lines changed: 4 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix valgrind warning by initializing the f-string buffers to 0 in the
2+
tokenizer. Patch by Pablo Galindo
Collapse file

‎Parser/lexer/state.c‎

Copy file name to clipboardExpand all lines: Parser/lexer/state.c
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
struct tok_state *
1313
_PyTokenizer_tok_new(void)
1414
{
15-
struct tok_state *tok = (struct tok_state *)PyMem_Malloc(
15+
struct tok_state *tok = (struct tok_state *)PyMem_Calloc(
16+
1,
1617
sizeof(struct tok_state));
1718
if (tok == NULL)
1819
return NULL;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.