Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4f22a8d7
Commit
4f22a8d7
authored
Feb 22, 2012
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #14084: Fix a file descriptor leak when importing a module with a bad encoding.
parent
72146124
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Misc/NEWS
Misc/NEWS
+3
-0
Python/import.c
Python/import.c
+3
-1
No files found.
Misc/NEWS
View file @
4f22a8d7
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.2.3?
Core and Builtins
-----------------
- Issue #14084: Fix a file descriptor leak when importing a module with a
bad encoding.
- Issue #13703: oCERT-2011-003: add -R command-line option and PYTHONHASHSEED
environment variable, to provide an opt-in way to protect against denial of
service attacks due to hash collisions within the dict and set types. Patch
...
...
Python/import.c
View file @
4f22a8d7
...
...
@@ -3195,8 +3195,10 @@ call_find_module(char *name, PyObject *path)
memory. */
found_encoding
=
PyTokenizer_FindEncoding
(
fd
);
lseek
(
fd
,
0
,
0
);
/* Reset position */
if
(
found_encoding
==
NULL
&&
PyErr_Occurred
())
if
(
found_encoding
==
NULL
&&
PyErr_Occurred
())
{
close
(
fd
);
return
NULL
;
}
encoding
=
(
found_encoding
!=
NULL
)
?
found_encoding
:
(
char
*
)
PyUnicode_GetDefaultEncoding
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment