We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 713ac39 commit 7e01e05Copy full SHA for 7e01e05
Modules/_testexternalinspection.c
@@ -1490,7 +1490,13 @@ append_awaited_by_for_thread(
1490
return -1;
1491
}
1492
1493
- while ((uintptr_t)task_node.next != head_addr) {
+size_t iteration_count = 0;
1494
+const size_t MAX_ITERATIONS = 100000; // Reasonable upper bound
1495
+while ((uintptr_t)task_node.next != head_addr) {
1496
+ if (++iteration_count > MAX_ITERATIONS) {
1497
+ PyErr_SetString(PyExc_RuntimeError, "Task list appears corrupted");
1498
+ return -1;
1499
+ }
1500
uintptr_t task_addr = (uintptr_t)task_node.next
1501
- async_offsets->asyncio_task_object.task_node;
1502
0 commit comments