[issue26169] Pasting 900000 chars into a tk Entry widget fails

Terry J. Reedy report at bugs.python.org
Wed Jan 20 22:20:36 EST 2016


New submission from Terry J. Reedy:

'\x41' == 'A'.  I don't know what 'BOF' has to do with the character 'A' or a string of them.

A python or pythonw process 'hanging' does not itself mean that there is a buffer overflow, though I can understand why you suspect it.  Python itself is pretty much immune from buffer overflows, but C code is not ;-).

IDLE crashing is not necessarily an IDLE issue.  IDLE is a application written in Python, including tkinter, which runs tcl/tk code.  It is just as vulnerable to Python, tkinter, and tcl/tk bugs and liminations as any other application.  This appears to be an issue about the limitations of the tcl/tk Entry widget.

When I followed the procedure posted with 3.5.1 on 64 bit Win 10 and pasted the megastring into the tk Entry box, the box stayed blank and a blue circle 'waiting' cursor appeared.  Even if the string was copied from the clipboard into process memory, it exceeded the (undocumented?) limits of the widget.

This behavior can be reproduced independently of IDLE with

import tkinter as tk
root = tk.Tk()
entry = tk.Entry(root)
entry.pack()
root.mainloop()

The latter has been waiting for several minutes.  This does not surprise me.

When I clicked the Search dialog Find-next button, the dialog box turned the whitish gray, all too familiar to me, that indicates that a process is no longer responsive.  This also does not surprise me.  The click causes the associated Python callback to be called.  It tries to get the Entry box text that is likely not available, compile it as a regex with re, and then search the editor text. 

Since we do not control tk Entry widgets, I am inclined to close this as '3rd party'.  Serhiy, what do you think?

PS: the test Entry box is still waiting.  Trying to close it fails and brings up a 'Python is not responding' box as in the screenshot.  I has to kill the process with Task Manager, just as with the IDLE Search window.

----------
components: +Tkinter -IDLE
nosy: +serhiy.storchaka -kbk, roger.serwy
title: Buffer OverFlow in IDLE 2.7.11 -> Pasting 900000 chars into a tk Entry widget fails
versions: +Python 3.5

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


More information about the Python-bugs-list mailing list