From: Miss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 13 Oct 2020 07:09:08 +0000 (-0700) Subject: bpo-41995: Fix null ptr deref in tracemalloc_copy_trace() (GH-22660) X-Git-Tag: v3.9.1rc1~173 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=afe86066e748076f970ccd277fc64fc51bea189b;p=thirdparty%2FPython%2Fcpython.git bpo-41995: Fix null ptr deref in tracemalloc_copy_trace() (GH-22660) Fix a null pointer dereference in tracemalloc_copy_trace() of _tracemalloc. (cherry picked from commit 66c28f50c76e4f23af7146e0e580457c5fd6bde7) Co-authored-by: Yunlongs --- diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index fc91622d3925..04f6c243b5ca 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -1199,7 +1199,7 @@ tracemalloc_copy_trace(_Py_hashtable_t *traces, trace_t *trace = (trace_t *)value; trace_t *trace2 = raw_malloc(sizeof(trace_t)); - if (traces2 == NULL) { + if (trace2 == NULL) { return -1; } *trace2 = *trace;