Kaydet (Commit) 5bacec18 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Fix another buffer overflow.

üst 0f95ba93
......@@ -58,7 +58,7 @@ str2uni(const char* s)
PyErr_SetString(PyExc_ValueError, "Cannot convert byte to string");
return NULL;
}
if (needed < sizeof(smallbuf))
if (needed*sizeof(wchar_t) < sizeof(smallbuf))
dest = smallbuf;
else {
dest = PyMem_Malloc((needed+1)*sizeof(wchar_t));
......
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