Skip to content

Commit 89d8623

Browse files
committed
Fix possible buffer overflow on Windows when reading code page.
Backport of fix for bug #1501223.
1 parent f608088 commit 89d8623

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎Misc/NEWS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ Extension Modules
3838
Library
3939
-------
4040

41+
- Bug #1501223: Possible overflow in _PySys_Init() when reading the code page
42+
under Windows.
43+
4144
- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
4245
new flag when ``name`` is already the name of an option flag.
4346

‎Python/sysmodule.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ _PySys_Init(void)
940940
PyObject *sysin, *sysout, *syserr;
941941
char *s;
942942
#ifdef MS_WINDOWS
943-
char buf[10];
943+
char buf[13];
944944
#endif
945945

946946
m = Py_InitModule3("sys", sys_methods, sys_doc);

0 commit comments

Comments
 (0)