summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-04-10 12:46:51 (GMT)
committerGuido van Rossum <guido@python.org>2000-04-10 12:46:51 (GMT)
commit5db862dd0cae0077b09a765220bb358e0e129449 (patch)
tree997e545b6dab223b7828d96ac9c39f26e5fe4d14 /Objects/object.c
parentfa972c987c394507ca6fb76de5ef0b47e9301226 (diff)
downloadcpython-5db862dd0cae0077b09a765220bb358e0e129449.zip
cpython-5db862dd0cae0077b09a765220bb358e0e129449.tar.gz
cpython-5db862dd0cae0077b09a765220bb358e0e129449.tar.bz2
Skip Montanaro: add string precisions to calls to PyErr_Format
to prevent possible buffer overruns.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index ab10e3e..265ab9b 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -236,7 +236,7 @@ PyObject_Repr(v)
return NULL;
if (!PyString_Check(res)) {
PyErr_Format(PyExc_TypeError,
- "__repr__ returned non-string (type %s)",
+ "__repr__ returned non-string (type %.200s)",
res->ob_type->tp_name);
Py_DECREF(res);
return NULL;
@@ -273,7 +273,7 @@ PyObject_Str(v)
return NULL;
if (!PyString_Check(res)) {
PyErr_Format(PyExc_TypeError,
- "__str__ returned non-string (type %s)",
+ "__str__ returned non-string (type %.200s)",
res->ob_type->tp_name);
Py_DECREF(res);
return NULL;