summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-10-10 14:18:20 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-10-10 14:18:20 (GMT)
commit2fe9bac4dca34e86d44b7e169f3795fde4c841a1 (patch)
treebdfa2e05ffa05074b815c1c02ec23d3effcd23d3 /Misc/NEWS
parent6cf185dc064577c6f472c86741e91fb28ec82e2d (diff)
downloadcpython-2fe9bac4dca34e86d44b7e169f3795fde4c841a1.zip
cpython-2fe9bac4dca34e86d44b7e169f3795fde4c841a1.tar.gz
cpython-2fe9bac4dca34e86d44b7e169f3795fde4c841a1.tar.bz2
Close #16742: Fix misuse of memory allocations in PyOS_Readline()
The GIL must be held to call PyMem_Malloc(), whereas PyOS_Readline() releases the GIL to read input. The result of the C callback PyOS_ReadlineFunctionPointer must now be a string allocated by PyMem_RawMalloc() or PyMem_RawRealloc() (or NULL if an error occurred), instead of a string allocated by PyMem_Malloc() or PyMem_Realloc(). Fixing this issue was required to setup a hook on PyMem_Malloc(), for example using the tracemalloc module. PyOS_Readline() copies the result of PyOS_ReadlineFunctionPointer() into a new buffer allocated by PyMem_Malloc(). So the public API of PyOS_Readline() does not change.
Diffstat (limited to 'Misc/NEWS')
-rw-r--r--Misc/NEWS5
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 04132c6..3044d85 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,11 @@ Projected release date: 2013-10-20
Core and Builtins
-----------------
+- Issue #16742: The result of the C callback PyOS_ReadlineFunctionPointer must
+ now be a string allocated by PyMem_RawMalloc() or PyMem_RawRealloc() (or NULL
+ if an error occurred), instead of a string allocated by PyMem_Malloc() or
+ PyMem_Realloc().
+
- Issue #19199: Remove ``PyThreadState.tick_counter`` field
- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at