Staging
v0.5.1
https://github.com/python/cpython
Revision bfa4fe4f39dd8b5ce1a0b649cedd36857859081a authored by Nir Soffer on 10 July 2017, 21:06:57 UTC, committed by Berker Peksag on 10 July 2017, 21:06:57 UTC
If history-length is set in .inputrc, and the history file is double the
history size (or more), history_get(N) returns NULL, and python
segfaults. Fix that by checking for NULL return value.

It seems that the root cause is incorrect handling of bigger history in
readline, but Python should not segfault even if readline returns
unexpected value.

This issue affects only GNU readline. When using libedit emulation
system history size option does not work.

This is a backport of the actual fix from master without the test, since
the test depends on new run_pty() helper which is not available in 2.7.
1 parent 5d1554a
History
Tip revision: bfa4fe4f39dd8b5ce1a0b649cedd36857859081a authored by Nir Soffer on 10 July 2017, 21:06:57 UTC
[2.7] bpo-29854: Fix segfault in call_readline() (GH-728)
Tip revision: bfa4fe4
File Mode Size
_ctypes
_io
_multiprocessing
_sqlite
cjkcodecs
expat
zlib
Setup.config.in -rw-r--r-- 406 bytes
Setup.dist -rw-r--r-- 18.0 KB
_bisectmodule.c -rw-r--r-- 7.2 KB
_bsddb.c -rw-r--r-- 271.6 KB
_codecsmodule.c -rw-r--r-- 32.7 KB
_collectionsmodule.c -rw-r--r-- 52.9 KB
_csv.c -rw-r--r-- 48.2 KB
_curses_panel.c -rw-r--r-- 13.4 KB
_cursesmodule.c -rw-r--r-- 87.3 KB
_elementtree.c -rw-r--r-- 81.8 KB
_functoolsmodule.c -rw-r--r-- 11.6 KB
_hashopenssl.c -rw-r--r-- 25.4 KB
_heapqmodule.c -rw-r--r-- 21.8 KB
_hotshot.c -rw-r--r-- 47.7 KB
_json.c -rw-r--r-- 76.9 KB
_localemodule.c -rw-r--r-- 19.0 KB
_lsprof.c -rw-r--r-- 26.8 KB
_math.c -rw-r--r-- 7.0 KB
_math.h -rw-r--r-- 995 bytes
_randommodule.c -rw-r--r-- 19.6 KB
_sre.c -rw-r--r-- 119.0 KB
_ssl.c -rw-r--r-- 129.6 KB
_ssl_data.h -rw-r--r-- 67.9 KB
_struct.c -rw-r--r-- 57.6 KB
_testcapimodule.c -rw-r--r-- 82.0 KB
_tkinter.c -rw-r--r-- 96.7 KB
_weakref.c -rw-r--r-- 4.2 KB
addrinfo.h -rw-r--r-- 6.1 KB
almodule.c -rw-r--r-- 90.0 KB
ar_beos -rwxr-xr-x 1.8 KB
arraymodule.c -rw-r--r-- 65.3 KB
atexitmodule.c -rw-r--r-- 8.7 KB
audioop.c -rw-r--r-- 52.0 KB
binascii.c -rw-r--r-- 51.1 KB
bsddb.h -rw-r--r-- 10.5 KB
bsddbmodule.c -rw-r--r-- 23.0 KB
bz2module.c -rw-r--r-- 68.3 KB
cPickle.c -rw-r--r-- 151.5 KB
cStringIO.c -rw-r--r-- 21.2 KB
cdmodule.c -rw-r--r-- 21.5 KB
cgen.py -rw-r--r-- 15.0 KB
cgensupport.c -rw-r--r-- 7.2 KB
cgensupport.h -rw-r--r-- 2.4 KB
clmodule.c -rw-r--r-- 73.7 KB
cmathmodule.c -rw-r--r-- 36.5 KB
config.c.in -rw-r--r-- 1.5 KB
cryptmodule.c -rw-r--r-- 1.2 KB
cstubs -rw-r--r-- 32.4 KB
datetimemodule.c -rw-r--r-- 167.3 KB
dbmmodule.c -rw-r--r-- 11.3 KB
dlmodule.c -rw-r--r-- 7.2 KB
errnomodule.c -rw-r--r-- 24.0 KB
fcntlmodule.c -rw-r--r-- 17.5 KB
flmodule.c -rw-r--r-- 55.7 KB
fmmodule.c -rw-r--r-- 6.0 KB
fpectlmodule.c -rw-r--r-- 11.2 KB
fpetestmodule.c -rw-r--r-- 5.5 KB
future_builtins.c -rw-r--r-- 3.0 KB
gc_weakref.txt -rw-r--r-- 11.2 KB
gcmodule.c -rw-r--r-- 50.6 KB
gdbmmodule.c -rw-r--r-- 15.5 KB
getaddrinfo.c -rw-r--r-- 18.4 KB
getbuildinfo.c -rw-r--r-- 1.3 KB
getnameinfo.c -rw-r--r-- 6.2 KB
getpath.c -rw-r--r-- 21.3 KB
glmodule.c -rw-r--r-- 176.4 KB
grpmodule.c -rw-r--r-- 5.1 KB
imageop.c -rw-r--r-- 20.4 KB
imgfile.c -rw-r--r-- 13.0 KB
itertoolsmodule.c -rw-r--r-- 132.9 KB
ld_so_aix.in -rw-r--r-- 6.1 KB
ld_so_beos -rwxr-xr-x 1.8 KB
linuxaudiodev.c -rw-r--r-- 14.2 KB
main.c -rw-r--r-- 20.8 KB
makesetup -rwxr-xr-x 7.3 KB
makexp_aix -rwxr-xr-x 3.2 KB
mathmodule.c -rw-r--r-- 52.0 KB
md5.c -rw-r--r-- 13.0 KB
md5.h -rw-r--r-- 3.3 KB
md5module.c -rw-r--r-- 8.5 KB
mmapmodule.c -rw-r--r-- 44.7 KB
nismodule.c -rw-r--r-- 11.2 KB
operator.c -rw-r--r-- 30.4 KB
ossaudiodev.c -rw-r--r-- 31.8 KB
parsermodule.c -rw-r--r-- 102.4 KB
posixmodule.c -rw-r--r-- 263.8 KB
posixmodule.h -rw-r--r-- 521 bytes
puremodule.c -rw-r--r-- 31.9 KB
pwdmodule.c -rw-r--r-- 5.6 KB
pyexpat.c -rw-r--r-- 64.4 KB
python.c -rw-r--r-- 520 bytes
readline.c -rw-r--r-- 32.5 KB
resource.c -rw-r--r-- 10.0 KB
rotatingtree.c -rw-r--r-- 3.4 KB
rotatingtree.h -rw-r--r-- 901 bytes
selectmodule.c -rw-r--r-- 59.2 KB
sgimodule.c -rw-r--r-- 1.1 KB
sha256module.c -rw-r--r-- 22.5 KB
sha512module.c -rw-r--r-- 28.2 KB
shamodule.c -rw-r--r-- 18.2 KB
signalmodule.c -rw-r--r-- 25.6 KB
socketmodule.c -rw-r--r-- 157.5 KB
socketmodule.h -rw-r--r-- 6.7 KB
spwdmodule.c -rw-r--r-- 4.9 KB
sre.h -rw-r--r-- 2.9 KB
sre_constants.h -rw-r--r-- 2.4 KB
stropmodule.c -rw-r--r-- 33.3 KB
sunaudiodev.c -rw-r--r-- 12.6 KB
svmodule.c -rw-r--r-- 24.1 KB
symtablemodule.c -rw-r--r-- 2.6 KB
syslogmodule.c -rw-r--r-- 9.4 KB
termios.c -rw-r--r-- 20.1 KB
testcapi_long.h -rw-r--r-- 5.9 KB
threadmodule.c -rw-r--r-- 29.0 KB
timemodule.c -rw-r--r-- 31.5 KB
timing.h -rw-r--r-- 2.4 KB
timingmodule.c -rw-r--r-- 1.1 KB
tkappinit.c -rw-r--r-- 5.2 KB
tkinter.h -rw-r--r-- 1.2 KB
unicodedata.c -rw-r--r-- 37.3 KB
unicodedata_db.h -rw-r--r-- 423.5 KB
unicodename_db.h -rw-r--r-- 1.3 MB
xxmodule.c -rw-r--r-- 11.7 KB
xxsubtype.c -rw-r--r-- 10.4 KB
yuv.h -rw-r--r-- 2.7 KB
yuvconvert.c -rw-r--r-- 3.7 KB
zipimport.c -rw-r--r-- 39.3 KB
zlibmodule.c -rw-r--r-- 33.7 KB

back to top