]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41995: Fix null ptr deref in tracemalloc_copy_trace() (GH-22660)
authorYunlongs <lylgood@foxmail.com>
Tue, 13 Oct 2020 06:46:31 +0000 (14:46 +0800)
committerGitHub <noreply@github.com>
Tue, 13 Oct 2020 06:46:31 +0000 (08:46 +0200)
Fix a null pointer dereference in tracemalloc_copy_trace()
of _tracemalloc.

Modules/_tracemalloc.c

index fc91622d3925b8424880b48bdd8f0f3a411fad9c..04f6c243b5ca4d1fdb539ffadb4ba8244846f875 100644 (file)
@@ -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;