Skip to content

Commit 9368d38

Browse files
committed
Only accept a flag of 1 to mean remote debugging is enabled
This helps to harden a bit against heap corruption.
1 parent 9344d1d commit 9368d38

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/remote_debugging.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,10 @@ send_exec_to_proc_handle(proc_handle_t *handle, int tid, const char *debugger_sc
795795
return -1;
796796
}
797797

798-
if (is_remote_debugging_enabled == 0) {
799-
PyErr_SetString(PyExc_RuntimeError, "Remote debugging is not enabled in the remote process");
798+
if (is_remote_debugging_enabled != 1) {
799+
PyErr_SetString(
800+
PyExc_RuntimeError,
801+
"Remote debugging is not enabled in the remote process");
800802
return -1;
801803
}
802804

0 commit comments

Comments
 (0)