mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
win32: Don't crash when installed in a top-level directory
Avoid NULL-pointer dereference when package installation directory doesn't contain any slashes. Reported by Paweł Forysiuk.
This commit is contained in:
parent
fed1cfb122
commit
b21dd67d60
@ -59,7 +59,8 @@ _gtk_get_libdir (void)
|
||||
{
|
||||
gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll);
|
||||
gchar *slash = strrchr (root, '\\');
|
||||
if (g_ascii_strcasecmp (slash + 1, ".libs") == 0)
|
||||
if (slash != NULL &&
|
||||
g_ascii_strcasecmp (slash + 1, ".libs") == 0)
|
||||
gtk_libdir = GTK_LIBDIR;
|
||||
else
|
||||
gtk_libdir = g_build_filename (root, "lib", NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user