This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix crash in xmlprase_GetInputContext in pyexpat.c
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: laotzu0, loewis
Priority: high Keywords: patch

Created on 2005-02-08 13:25 by laotzu0, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pyexpat-patch.diff laotzu0, 2005-02-08 13:25 patch against Python 2.4
Messages (2)
msg47731 - (view) Author: Mathieu Fenniak (laotzu0) Date: 2005-02-08 13:25
I've run across a couple of cases where pyexpat will crash in 
xmlparse_GetInputContext.  The problem stems from the 'offset' 
variable that can be returned from XML_GetInputContext - if it is 
non-zero, then the size being passed into 
PyString_FromStringAndSize is incorrectly too large.  The offset 
should be subtracted from that size.

I cannot provide a test case to reproduce this - my attempts to 
create a minimal test case do not crash.  The application I'm 
developing is using simpleTAL and when a large XML comment 
(multiline Javascript) is entered in the software templates it will 
often crash.  This seems to only occur on a Python installation 
where the module xml.sax.saxlib is not present (i.e. PyXML is not 
installed) - I'm not sure why this is.
msg47732 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-03-04 14:41
Logged In: YES 
user_id=21627

Thanks for the patch, applied as

pyexpat.c 2.90 and 2.89.2.1
NEWS 1.1264 and 1.1193.2.31

It turns out that this was essentially a duplicate of 925152.
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41546
2005-02-08 13:25:23laotzu0create