Re: [PATCH virt-viewer v4 2/3] session-spice: Set fullscreen displays according to monitor-mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2015-05-04 at 17:20 +0200, Pavel Grunt wrote:
> It is necessary to follow the monitor mapping, otherwise a display
> can get dimensions which belongs to other than desired monitor.
> 
> Related: rhbz#1212802
> ---
>  src/virt-viewer-session-spice.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
> index b69faa6..c1333dd 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -866,7 +866,7 @@ virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
>      displays = g_new0(GdkRectangle, ndisplays);
>  
>      for (i = 0, l = initial_displays; l != NULL; l = l->next, i++) {
> -        GdkRectangle* rect = &displays[i];
> +        GdkRectangle* rect = &displays[GPOINTER_TO_INT(l->data)];
>          gint j = virt_viewer_app_get_initial_monitor_for_display(app, GPOINTER_TO_INT(l->data));
>          if (j == -1)
>              continue;

I feel that this is a little bit risky because we're not validating that
GPOINTER_TO_INT(l->data) is less than ndisplays. It's true that you did
guarantee that on your previous commit, but that's in a totally
different section of code. In the future, somebody might change that
behavior without realizing that it could create an illegal array access
in this location. So I think we should validate our assumptions in this
location as well.

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux