File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ What's New in Python 3.2.3?
1010Core and Builtins
1111-----------------
1212
13+ - Issue #14084: Fix a file descriptor leak when importing a module with a
14+ bad encoding.
15+
1316- Issue #13703: oCERT-2011-003: add -R command-line option and PYTHONHASHSEED
1417 environment variable, to provide an opt-in way to protect against denial of
1518 service attacks due to hash collisions within the dict and set types. Patch
Original file line number Diff line number Diff line change @@ -3195,8 +3195,10 @@ call_find_module(char *name, PyObject *path)
31953195 memory. */
31963196 found_encoding = PyTokenizer_FindEncoding (fd );
31973197 lseek (fd , 0 , 0 ); /* Reset position */
3198- if (found_encoding == NULL && PyErr_Occurred ())
3198+ if (found_encoding == NULL && PyErr_Occurred ()) {
3199+ close (fd );
31993200 return NULL ;
3201+ }
32003202 encoding = (found_encoding != NULL ) ? found_encoding :
32013203 (char * )PyUnicode_GetDefaultEncoding ();
32023204 }
You can’t perform that action at this time.
0 commit comments