Issue #22028: Ensure mimetypes will not open registry keys with embedded nulls

This commit is contained in:
Steve Dower 2015-03-10 13:20:21 -07:00
commit 12541dc22e
1 changed files with 2 additions and 1 deletions

View File

@ -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: