summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2005-03-04 14:37:01 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2005-03-04 14:37:01 (GMT)
commitfd78a6f7f8c507678238c7264f7426c3148b6a84 (patch)
treef24796353b38b2cd2c28057f75296522cd44cbf5 /Modules/pyexpat.c
parenta2a9888f22a7811938d2f708344e01dfc000841c (diff)
downloadcpython-fd78a6f7f8c507678238c7264f7426c3148b6a84.zip
cpython-fd78a6f7f8c507678238c7264f7426c3148b6a84.tar.gz
cpython-fd78a6f7f8c507678238c7264f7426c3148b6a84.tar.bz2
Patches #925152, #1118602: Avoid reading after the end of the buffer
in pyexpat.GetInputContext. Will backport to 2.4.
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index d359a74..e6c14f8 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1082,7 +1082,7 @@ xmlparse_GetInputContext(xmlparseobject *self, PyObject *args)
= XML_GetInputContext(self->itself, &offset, &size);
if (buffer != NULL)
- result = PyString_FromStringAndSize(buffer + offset, size);
+ result = PyString_FromStringAndSize(buffer + offset, size - offset);
else {
result = Py_None;
Py_INCREF(result);