Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ebb8c2d

Browse files
committed
Issue #22028: Ensure mimetypes will not open registry keys with embedded nulls
1 parent 7a82afe commit ebb8c2d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/mimetypes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ def enum_types(mimedb):
246246
except EnvironmentError:
247247
break
248248
else:
249-
yield ctype
249+
if '\0' not in ctype:
250+
yield ctype
250251
i += 1
251252

252253
with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, '') as hkcr:

0 commit comments

Comments
 (0)