Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7e01e05

Browse files
ambvpablogsal
andauthored
Add MAX_ITERATIONS
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
1 parent713ac39 commit7e01e05

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎Modules/_testexternalinspection.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,13 @@ append_awaited_by_for_thread(
14901490
return-1;
14911491
}
14921492

1493-
while ((uintptr_t)task_node.next!=head_addr) {
1493+
size_titeration_count=0;
1494+
constsize_tMAX_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+
}
14941500
uintptr_ttask_addr= (uintptr_t)task_node.next
14951501
-async_offsets->asyncio_task_object.task_node;
14961502

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp