[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

Martin Panter report at bugs.python.org
Mon Mar 6 16:01:38 EST 2017


Martin Panter added the comment:

“Input9)” is probably a typo for “input()”.

In Python 2, sys.stdin etc are by default wrappers around <stdio.h>’s “stdin” etc, and can easily be wrappers around other <stdio.h> FILE objects, so the PyOS_Readline API and Python’s “readline” module pass these <stdio.h> objects directly to rl_instream etc.

In Python 3, sys.stdin etc are not directly related to <stdio.h> objects. But the PyOS_Readline API was not changed, and the “readline” module still uses the rl_instream API which requires a <stdio.h> FILE object. So the new code decides if it is reasonable to substitute <stdio.h> “stdin” etc objects for the Python “sys” objects.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29700>
_______________________________________


More information about the Python-bugs-list mailing list