Issue 24010: Add error checks to PyInit__locale() (original) (raw)

Issue24010

Created on 2015-04-19 19:26 by christian.heimes, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
localemodule.patch christian.heimes,2015-04-19 19:26 review
Messages (3)
msg241550 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2015-04-19 19:26
The init function of the locale module fails to check for errors in a couple of places. The patch replaces PyDict_SetItemString() calls with PyModule_AddIntMacro() and error checks. An exception is unlikely so I'm OK when the patch just lands in 3.4 and 3.5. CID 1295027 (#8 of 8): Dereference null return value (NULL_RETURNS) dereference: Dereferencing a pointer that might be null x when calling PyDict_SetItemString
msg323670 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-17 20:46
A variant of localemodule.patch without error checking for PyModule_AddIntMacro() has been applied in https://github.com/python/cpython/commit/ff4fddde57d5579dff3a83d99e20cd06366b10d6. Christian, can this be closed or do we still need to add error checking to all PyModule_AddIntMacro() usages?
msg408326 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-11 17:56
This function now looks like this: PyMODINIT_FUNC PyInit__locale(void) { return PyModuleDef_Init(&_localemodule); }
History
Date User Action Args
2022-04-11 14:58:15 admin set github: 68198
2021-12-11 17:56:22 iritkatriel set status: open -> closednosy: + iritkatrielmessages: + resolution: out of datestage: patch review -> resolved
2018-08-17 20:46:59 berker.peksag set nosy: + berker.peksagmessages: +
2015-04-19 19:26:39 christian.heimes create