mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Fix another buffer overflow.
This commit is contained in:
parent
0f95ba9341
commit
5bacec1864
1 changed files with 1 additions and 1 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue