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

This commit is contained in:
Steve Dower 2015-03-10 13:17:21 -07:00
parent 7a82afee70
commit ebb8c2d528

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: