Kaydet (Commit) 5ec0bbf2 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #23055: Fixed off-by-one error in PyUnicode_FromFormatV.

üst 5606cd98
...@@ -893,7 +893,8 @@ PyUnicode_FromFormatV(const char *format, va_list vargs) ...@@ -893,7 +893,8 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
} }
expand: expand:
if (abuffersize > 20) { if (abuffersize > 20) {
abuffer = PyObject_Malloc(abuffersize); /* add 1 for sprintf's trailing null byte */
abuffer = PyObject_Malloc(abuffersize + 1);
if (!abuffer) { if (!abuffer) {
PyErr_NoMemory(); PyErr_NoMemory();
goto fail; goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment