GDesktopAppInfo: Ensure that URI scheme is a valid argument

This commit is contained in:
Marco Trevisan (Treviño)
2022-06-14 16:30:42 +02:00
parent c87602451c
commit 6fef60b65c
2 changed files with 23 additions and 0 deletions

View File

@@ -4626,6 +4626,8 @@ g_app_info_get_default_for_uri_scheme (const char *uri_scheme)
GAppInfo *app_info;
char *content_type, *scheme_down;
g_return_val_if_fail (uri_scheme != NULL && *uri_scheme != '\0', NULL);
scheme_down = g_ascii_strdown (uri_scheme, -1);
content_type = g_strdup_printf ("x-scheme-handler/%s", scheme_down);
g_free (scheme_down);