From: Christian Persch Date: Sun, 9 May 2010 23:30:11 +0000 (+0200) Subject: [shell] Safely get the screen from the message arguments X-Git-Tag: EVINCE_2_31_2~35 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=bf81d8f6045121a886dd37cde1e25c2e4e9da233;p=evince.git [shell] Safely get the screen from the message arguments Check for out-of-bounds. --- diff --git a/shell/ev-application.c b/shell/ev-application.c index a09906ce..050b396f 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -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 ();