[Spice-devel] [vdagent-linux 1/3] Handle get_current_mon_config() failures

Fabiano Fidêncio fabiano at fidencio.org
Tue Sep 23 08:58:15 PDT 2014


On Tue, Sep 23, 2014 at 5:32 PM, Christophe Fergeau <cfergeau at redhat.com>
wrote:

> get_current_mon_config() can return NULL, but
> vdagent_x11_set_monitor_config() was calling it without checking if it's
> NULL before dereferencing it.
> This issue was pinpointed by Coverity.
> ---
>  src/vdagent-x11-randr.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c
> index 46367bc..f48f045 100644
> --- a/src/vdagent-x11-randr.c
> +++ b/src/vdagent-x11-randr.c
> @@ -735,6 +735,8 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11
> *x11,
>      }
>
>      curr = get_current_mon_config(x11);
> +    if (!curr)
> +        goto exit;
>      if (same_monitor_configs(mon_config, curr) &&
>             x11->width[0] == primary_w && x11->height[0] == primary_h) {
>          goto exit;
> --
> 1.9.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>

ACK the series!

-- 
Fabiano Fidêncio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140923/96523921/attachment.html>


More information about the Spice-devel mailing list