summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-10-09 01:37:11 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-10-09 01:37:11 (GMT)
commit3fa36ff5e4991550e31cc7ab55dc3a2165c2ffa3 (patch)
treeb9af47cc2c43e6674f9a5a95cc89cc4727a06777 /Objects
parent797485e10135ca323565b22b4fabf1e161a5ec7a (diff)
downloadcpython-3fa36ff5e4991550e31cc7ab55dc3a2165c2ffa3.zip
cpython-3fa36ff5e4991550e31cc7ab55dc3a2165c2ffa3.tar.gz
cpython-3fa36ff5e4991550e31cc7ab55dc3a2165c2ffa3.tar.bz2
Issue #25318: Fix backslashreplace()
Fix code to estimate the needed space.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 10cdcc0..a3bbf92 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -590,7 +590,7 @@ backslashreplace(_PyBytesWriter *writer, Py_ssize_t prealloc_per_char,
incr = 2+4;
else {
assert(ch <= MAX_UNICODE);
- incr = 2+6;
+ incr = 2+8;
}
if (size > PY_SSIZE_T_MAX - incr) {
PyErr_SetString(PyExc_OverflowError,