https://github.com/python/cpython/commit/0ed497a350d76dd20de1a1689c84426c7c1d6e22
commit: 0ed497a350d76dd20de1a1689c84426c7c1d6e22
branch: main
author: Nezuko Agent <[email protected]>
committer: sobolevn <[email protected]>
date: 2026-05-18T11:28:28+03:00
summary:

gh-149953: Fix null pointer dereference order in `code_objects.c` (#149956)

Move  check before

files:
M Modules/_remote_debugging/code_objects.c

diff --git a/Modules/_remote_debugging/code_objects.c 
b/Modules/_remote_debugging/code_objects.c
index 7b95c0f2d4fa8d..97c6ba772e88f1 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;

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to