[Python-bugs-list] [ python-Bugs-565993 ] string.replace() can corrupt heap
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 07 Jun 2002 14:27:40 -0700
Bugs item #565993, was opened at 2002-06-07 15:27
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=565993&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Mike Romberg (romberg)
Assigned to: Nobody/Anonymous (nobody)
Summary: string.replace() can corrupt heap
Initial Comment:
I've been using a tool called mpatrol
(http://www.cbmamiga.demon.co.uk/mpatrol/) to cleanup an
embeded python application we have and ran into this
bug. It seems to affect a stock python as well. Under
certain
conditions it appears that one can get python to acess
freed
memory by calling string.replace or the string replace
method.
Here is an example python command which reproduces
the problem:
python -c "a = 'a\000'; a.replace('\000', '')"
The mpatrol library dumps the following logfile:
(see attachment)
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=565993&group_id=5470