]> Pileus Git - ~andy/gtk/commitdiff
win32: Don't crash when installed in a top-level directory
authorKalev Lember <kalevlember@gmail.com>
Thu, 9 Feb 2012 13:12:22 +0000 (15:12 +0200)
committerKalev Lember <kalevlember@gmail.com>
Thu, 9 Feb 2012 15:58:21 +0000 (17:58 +0200)
Avoid NULL-pointer dereference when package installation directory
doesn't contain any slashes.

Reported by PaweÅ‚ Forysiuk.

gtk/gtkwin32.c

index b582942a7e63750499a8c4226b0340f0bcef3100..e9ba709d873848238cedc4d0cf774a5780f02700 100644 (file)
@@ -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);