From 89d862360cc15c20783f4aa0775a3d2450f1bd7b Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Mon, 5 Jun 2006 23:56:36 +0000 Subject: [PATCH] Fix possible buffer overflow on Windows when reading code page. Backport of fix for bug #1501223. --- Misc/NEWS | 3 +++ Python/sysmodule.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS b/Misc/NEWS index cac884c98dad..93d16279166a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -38,6 +38,9 @@ Extension Modules Library ------- +- Bug #1501223: Possible overflow in _PySys_Init() when reading the code page + under Windows. + - Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a new flag when ``name`` is already the name of an option flag. diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 1ce016f3f7a1..b51fa86a760c 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -940,7 +940,7 @@ _PySys_Init(void) PyObject *sysin, *sysout, *syserr; char *s; #ifdef MS_WINDOWS - char buf[10]; + char buf[13]; #endif m = Py_InitModule3("sys", sys_methods, sys_doc); -- 2.47.3