[PATCH weston 05/11] desktop-shell: Avoid NULL pointer dereference
Pekka Paalanen
ppaalanen at gmail.com
Mon Jun 20 13:39:16 UTC 2016
On Sun, 19 Jun 2016 11:16:35 +0200
Quentin Glidic <sardemff7+wayland at sardemff7.net> wrote:
> On 18/06/2016 19:15, Armin Krezović wrote:
> > When there are no outputs present, an output pointer
> > can be NULL. Dereferencing such pointer will result
> > in a crash.
> >
> > Signed-off-by: Armin Krezović <krezovic.armin at gmail.com>
> > ---
> > desktop-shell/shell.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> > index c48d41a..19a20ac 100644
> > --- a/desktop-shell/shell.c
> > +++ b/desktop-shell/shell.c
> > @@ -2290,7 +2290,7 @@ shell_surface_set_class(struct wl_client *client,
> > static void
> > restore_output_mode(struct weston_output *output)
> > {
> > - if (output->original_mode)
> > + if (output && output->original_mode)
> > weston_output_mode_switch_to_native(output);
> > }
> >
> >
>
> Sounds good.
> Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
fullscreen-shell.c has nother place like this.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160620/9673f2e2/attachment.sig>
More information about the wayland-devel
mailing list