]> granicus.if.org Git - python/commitdiff
make the PyUnicode_FSConverter cleanup set the decrefed argument to NULL (closes...
authorBenjamin Peterson <benjamin@python.org>
Mon, 16 Nov 2015 05:57:39 +0000 (21:57 -0800)
committerBenjamin Peterson <benjamin@python.org>
Mon, 16 Nov 2015 05:57:39 +0000 (21:57 -0800)
Misc/NEWS
Objects/unicodeobject.c

index f72f8ac1f12087900a7d22e3fd27c9207293dcf3..e6b3c5e7248204ebc38aea7b4af460afa3ba004e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -11,6 +11,9 @@ Release date: TBA
 Core and Builtins
 -----------------
 
+- Issue #25630: Fix a possible segfault during argument parsing in functions
+  that accept filesystem paths.
+
 - Issue #23564: Fixed a partially broken sanity check in the _posixsubprocess
   internals regarding how fds_to_pass were passed to the child.  The bug had
   no actual impact as subprocess.py already avoided it.
index 38f765da7279c0da749b18773112fb1a3bb7c3af..8b885dfec2b3685c05b1d4ee65dad19ba60d431c 100644 (file)
@@ -3614,6 +3614,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
     void *data;
     if (arg == NULL) {
         Py_DECREF(*(PyObject**)addr);
+        *(PyObject**)addr = NULL;
         return 1;
     }
     if (PyBytes_Check(arg)) {