summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-01-30 21:35:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-01-30 21:35:03 (GMT)
commit5ec0bbf27dfef0d486dca1177d8c86f37969474e (patch)
tree12a2c7df90dfbe869e8c8a13ad91de28cdab0e05 /Objects
parent5606cd980023f07d5cc8f063727990108f0875c4 (diff)
downloadcpython-5ec0bbf27dfef0d486dca1177d8c86f37969474e.zip
cpython-5ec0bbf27dfef0d486dca1177d8c86f37969474e.tar.gz
cpython-5ec0bbf27dfef0d486dca1177d8c86f37969474e.tar.bz2
Issue #23055: Fixed off-by-one error in PyUnicode_FromFormatV.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 2e5f5fd..1e3b812 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -893,7 +893,8 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
}
expand:
if (abuffersize > 20) {
- abuffer = PyObject_Malloc(abuffersize);
+ /* add 1 for sprintf's trailing null byte */
+ abuffer = PyObject_Malloc(abuffersize + 1);
if (!abuffer) {
PyErr_NoMemory();
goto fail;