]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix possible buffer overflow on Windows when reading code page.
authorBrett Cannon <bcannon@gmail.com>
Mon, 5 Jun 2006 23:56:36 +0000 (23:56 +0000)
committerBrett Cannon <bcannon@gmail.com>
Mon, 5 Jun 2006 23:56:36 +0000 (23:56 +0000)
Backport of fix for bug #1501223.

Misc/NEWS
Python/sysmodule.c

index cac884c98dad0f9e7c129ac0b562224844e36c51..93d16279166a6fc3c74db1655ea7f19407124e84 100644 (file)
--- 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.
 
index 1ce016f3f7a1dfcbb25dde44a8bd0c0df2ab4d6c..b51fa86a760cd46bdb2b33973afa7e6bf9ef85f3 100644 (file)
@@ -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);