diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-03-10 20:20:21 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-03-10 20:20:21 (GMT) |
commit | 12541dc22ef3bbc2469b910eeb8daa4cd5675873 (patch) | |
tree | 270675cb672242fa354c1cc48f2b75a67cc265ff /Lib | |
parent | 3d3aaa1eabee1f71045142fd46a4a213f921b1fb (diff) | |
parent | ebb8c2d528e07df71c345826fc1290327b1e369e (diff) | |
download | cpython-12541dc22ef3bbc2469b910eeb8daa4cd5675873.zip cpython-12541dc22ef3bbc2469b910eeb8daa4cd5675873.tar.gz cpython-12541dc22ef3bbc2469b910eeb8daa4cd5675873.tar.bz2 |
Issue #22028: Ensure mimetypes will not open registry keys with embedded nulls
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/mimetypes.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index b98c874..d64726b 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -246,7 +246,8 @@ class MimeTypes: except EnvironmentError: break else: - yield ctype + if '\0' not in ctype: + yield ctype i += 1 with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, '') as hkcr: |