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: