mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01:00
gwinhttpvfs: Handle g_get_prgname() returning NULL
When prgname wasn't set NULL would be passed to g_utf8_to_utf16() resulting in "g_utf8_to_utf16: assertion 'str != NULL' failed"
This commit is contained in:
parent
6192fd4cc0
commit
bf2a10211b
@ -121,12 +121,13 @@ static void
|
||||
g_winhttp_vfs_init (GWinHttpVfs *vfs)
|
||||
{
|
||||
wchar_t *wagent;
|
||||
const gchar *prgname = g_get_prgname ();
|
||||
|
||||
vfs->wrapped_vfs = g_vfs_get_local ();
|
||||
|
||||
wagent = g_utf8_to_utf16 (g_get_prgname (), -1, NULL, NULL, NULL);
|
||||
|
||||
if (!wagent)
|
||||
if (prgname)
|
||||
wagent = g_utf8_to_utf16 (prgname, -1, NULL, NULL, NULL);
|
||||
else
|
||||
wagent = g_utf8_to_utf16 ("GWinHttpVfs", -1, NULL, NULL, NULL);
|
||||
|
||||
vfs->session = (G_WINHTTP_VFS_GET_CLASS (vfs)->funcs->pWinHttpOpen)
|
||||
|
Loading…
Reference in New Issue
Block a user