GNOME Bugzilla – Bug 711065
xrandr: Prevent guint32 overflow
Last modified: 2013-10-30 10:59:21 UTC
.
Created attachment 258430 [details] [review] xrandr: Prevent guint32 overflow Passing "9223372036854775807" (G_MAXINT64) as the timestamp will overflow as the timestamp is cast to a guint32 internally. Clamp that value instead to avoid g-s-d crashing. See https://bugzilla.redhat.com/show_bug.cgi?id=1022562
Review of attachment 258430 [details] [review]: Looking at the code paths I don't see how this can crash the process. The timestamp always ends up in a call to XRRSetCrtcConfig in gnome_rr_crtc_set_config_with_time(). Indeed I couldn't make F19's g-s-d crash either with G_MAXINT64 or G_MININT64 for all the four DBus methods on this interface. BTW, this RH bug isn't public. In any case, the patch isn't wrong. ::: plugins/xrandr/gsd-xrandr-manager.c @@ +2203,3 @@ g_variant_get (parameters, "(xx)", &parent_window_id, ×tamp); if (gsd_xrandr_manager_2_apply_configuration (manager, parent_window_id, + clamp_timestamp(timestamp), &error) == FALSE) { in all 4 lines: space between method name and '('
I've pushed this.