From 7dd1d6afcc16342fecc70f667ff8ba13b0ad4372 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 9 Apr 2018 15:57:16 -0700 Subject: [PATCH] Prevent a heap pointer from living on the stack longer than we need. --- lib/utils/pyexec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index f96deb9e1ce11..718c6828cca12 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -90,6 +90,8 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input qstr source_name = lex->source_name; mp_parse_tree_t parse_tree = mp_parse(lex, input_kind); module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, exec_flags & EXEC_FLAG_IS_REPL); + // Clear the parse tree because it has a heap pointer we don't need anymore. + *((uint32_t volatile*) &parse_tree.chunk) = 0; #else mp_raise_msg(&mp_type_RuntimeError, "script compilation not supported"); #endif 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