From 6e83c55e643ac1c189535604e70b0328c0ebec44 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 18 May 2026 11:00:19 +0200 Subject: [PATCH] [3.15] gh-149953: Fix null pointer dereference order in `code_objects.c` (GH-149956) (#149976) gh-149953: Fix null pointer dereference order in `code_objects.c` (GH-149956) Move check before (cherry picked from commit 0ed497a350d76dd20de1a1689c84426c7c1d6e22) Co-authored-by: Nezuko Agent --- Modules/_remote_debugging/code_objects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_remote_debugging/code_objects.c b/Modules/_remote_debugging/code_objects.c index 7b95c0f2d4f..97c6ba772e8 100644 --- a/Modules/_remote_debugging/code_objects.c +++ b/Modules/_remote_debugging/code_objects.c @@ -432,7 +432,7 @@ parse_code_object(RemoteUnwinderObject *unwinder, #ifdef Py_GIL_DISABLED // Handle thread-local bytecode (TLBC) in free threading builds - if (ctx->tlbc_index == 0 || unwinder->debug_offsets.code_object.co_tlbc == 0 || unwinder == NULL) { + if (ctx->tlbc_index == 0 || unwinder == NULL || unwinder->debug_offsets.code_object.co_tlbc == 0) { // No TLBC or no unwinder - use main bytecode directly addrq = (uint16_t *)ip - (uint16_t *)meta->addr_code_adaptive; goto done_tlbc;