Skip to content

Commit a4d33b3

Browse files
committed
make the PyUnicode_FSConverter cleanup set the decrefed argument to NULL (closes python#25630)
1 parent d0a5b1c commit a4d33b3

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Release date: TBA
1111
Core and Builtins
1212
-----------------
1313

14+
- Issue #25630: Fix a possible segfault during argument parsing in functions
15+
that accept filesystem paths.
16+
1417
- Issue #23564: Fixed a partially broken sanity check in the _posixsubprocess
1518
internals regarding how fds_to_pass were passed to the child. The bug had
1619
no actual impact as subprocess.py already avoided it.

Objects/unicodeobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3614,6 +3614,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
36143614
void *data;
36153615
if (arg == NULL) {
36163616
Py_DECREF(*(PyObject**)addr);
3617+
*(PyObject**)addr = NULL;
36173618
return 1;
36183619
}
36193620
if (PyBytes_Check(arg)) {

0 commit comments

Comments
 (0)