commit | ebb8c2d528e07df71c345826fc1290327b1e369e | [log] [tgz] |
---|---|---|
author | Steve Dower <steve.dower@microsoft.com> | Tue Mar 10 13:17:21 2015 -0700 |
committer | Steve Dower <steve.dower@microsoft.com> | Tue Mar 10 13:17:21 2015 -0700 |
tree | 9739a7fbf0cce0001020c82c8e858b67ebb4e56b | |
parent | 7a82afee70425782d27f4ed2c6d0bad3aeb91f09 [diff] |
Issue #22028: Ensure mimetypes will not open registry keys with embedded nulls
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 @@ except EnvironmentError: break else: - yield ctype + if '\0' not in ctype: + yield ctype i += 1 with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, '') as hkcr: