diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-03-08 13:39:58 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-03-08 13:39:58 (GMT) |
commit | 5bacec1864d35297b19ec8e6de99f758ee12e0e2 (patch) | |
tree | 80ed6a27f25183ff941bc957b171ac15af204f24 /Modules | |
parent | 0f95ba93418f401441ce4c4e2bfc580306ee47d4 (diff) | |
download | cpython-5bacec1864d35297b19ec8e6de99f758ee12e0e2.zip cpython-5bacec1864d35297b19ec8e6de99f758ee12e0e2.tar.gz cpython-5bacec1864d35297b19ec8e6de99f758ee12e0e2.tar.bz2 |
Fix another buffer overflow.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_localemodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 1fba6b1..af36a59 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -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)); |