]> www.fi.muni.cz Git - evince.git/commitdiff
[shell] Safely get the screen from the message arguments
authorChristian Persch <chpe@gnome.org>
Sun, 9 May 2010 23:30:11 +0000 (01:30 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 25 May 2010 07:37:24 +0000 (09:37 +0200)
Check for out-of-bounds.

shell/ev-application.c

index a09906cee799fb5a649f6740d893e5ee135abf56..050b396f6c8539775aa9678757a34ada0b8cb9d2 100644 (file)
@@ -644,7 +644,9 @@ method_call_cb (GDBusConnection       *connection,
         }
         g_variant_iter_free (iter);
 
-        if (display != NULL)
+        if (display != NULL &&
+            screen_number >= 0 &&
+            screen_number < gdk_display_get_n_screens (display))
                 screen = gdk_display_get_screen (display, screen_number);
         else
                 screen = gdk_screen_get_default ();