From 5bacec1864d35297b19ec8e6de99f758ee12e0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sat, 8 Mar 2008 13:39:58 +0000 Subject: Fix another buffer overflow. --- Modules/_localemodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- cgit v0.12