FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-35269: Fix a possible segfault involving a newly-created coroutin… · python-emscripten/cpython@062a57b · GitHub

Repository navigation

Commit 062a57b

Browse files
authored andcommitted
bpo-35269: Fix a possible segfault involving a newly-created coroutine (pythonGH-10585)
coro->cr_origin wasn't initialized if compute_cr_origin() failed in PyCoro_New(), which would cause a crash during the coroutine's deallocation. https://bugs.python.org/issue35269
1 parent 177a41a commit 062a57b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a possible segfault involving a newly-created coroutine. Patch by
2+
Zackery Spytz.

‎Objects/genobject.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,11 +1164,11 @@ PyCoro_New(PyFrameObject *f, PyObject *name, PyObject *qualname)
11641164
((PyCoroObject *)coro)->cr_origin = NULL;
11651165
} else {
11661166
PyObject *cr_origin = compute_cr_origin(origin_depth);
1167+
((PyCoroObject *)coro)->cr_origin = cr_origin;
11671168
if (!cr_origin) {
11681169
Py_DECREF(coro);
11691170
return NULL;
11701171
}
1171-
((PyCoroObject *)coro)->cr_origin = cr_origin;
11721172
}
11731173

11741174
return coro;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL