gtk_show_uri() causes application crash with certain URI
Moving this from a downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1950882
The attached uri.c is a reproducer for the crash.
The backtrace:
hread 1 "uri" received signal SIGSEGV, Segmentation fault.
g_utf8_validate (str=str@entry=0x0, max_len=max_len@entry=-1, end=end@entry=0x0) at ../glib/gutf8.c:1671
1671 ../glib/gutf8.c: No such file or directory.
(gdb) bt
#0 g_utf8_validate (str=str@entry=0x0, max_len=max_len@entry=-1, end=end@entry=0x0) at ../glib/gutf8.c:1671
#1 0x00007ffff7759af2 in get_display_name (info=<optimized out>, file=0x59fc10) at x11/gdkapplaunchcontext-x11.c:48
#2 gdk_x11_app_launch_context_get_startup_notify_id (context=0x5df8d0, info=0x6d1200, files=<optimized out>)
at x11/gdkapplaunchcontext-x11.c:307
#3 0x00007ffff733bc71 in g_desktop_app_info_launch_uris_with_spawn
(info=info@entry=0x6d1200, session_bus=session_bus@entry=0x4701b0, exec_line=0x581560 "epiphany %U", uris=uris@entry=0x7fffffffd340 = {...}, launch_context=launch_context@entry=0x5df8d0, spawn_flags=spawn_flags@entry=G_SPAWN_SEARCH_PATH, user_setup=0x0, user_setup_data=0x0, pid_callback=0x0, pid_callback_data=0x0, stdin_fd=-1, stdout_fd=-1, stderr_fd=-1, task=0x0, error_out=0x0) at ../gio/gdesktopappinfo.c:3013
#4 0x00007ffff733c1ed in g_desktop_app_info_launch_uris_internal
(appinfo=<optimized out>, uris=0x7fffffffd340 = {...}, launch_context=0x5df8d0, spawn_flags=spawn_flags@entry=G_SPAWN_SEARCH_PATH, user_setup=user_setup@entry=0x0, user_setup_data=user_setup_data@entry=0x0, pid_callback=0x0, pid_callback_data=0x0, stdin_fd=-1, stdout_fd=-1, stderr_fd=-1, error=0x0) at ../gio/gdesktopappinfo.c:3371
#5 0x00007ffff733c283 in g_desktop_app_info_launch_uris
(appinfo=<optimized out>, uris=<optimized out>, launch_context=<optimized out>, error=<optimized out>)
at ../gio/gdesktopappinfo.c:3387
#6 0x00007ffff72bb6b5 in g_app_info_launch_default_for_uri
(uri=uri@entry=0x402010 "https://click.redditmail.com/CL0/https:%2F%2Fwww.reddit.com%2Fr%2Fthinkpad%2Fcomments%2Fmt81gr%2Fsentenced_to_use_a_thinkpad_what_a_date%2F%3F$deep_link=true%26correlation_id=054c8056-8a90-465e-8ac6-c"..., launch_context=launch_context@entry=0x5df8d0, error=error@entry=0x0) at ../gio/gappinfo.c:819
#7 0x00007ffff7ae94fa in gtk_show_uri
(screen=0x0, uri=0x402010 "https://click.redditmail.com/CL0/https:%2F%2Fwww.reddit.com%2Fr%2Fthinkpad%2Fcomments%2Fmt81gr%2Fsentenced_to_use_a_thinkpad_what_a_date%2F%3F$deep_link=true%26correlation_id=054c8056-8a90-465e-8ac6-c"..., timestamp=0, error=0x0) at /usr/src/debug/gtk3-3.24.28-2.fc35.x86_64/gtk/gtkshow.c:71
#8 0x0000000000401171 in main ()