[PATCH][weston] ivi-shell: initialize all fields in create_layout_transition
John-John Tedro
udoprog at tedro.se
Mon Sep 21 10:53:27 PDT 2015
On Mon, Sep 21, 2015 at 09:33:29AM -0700, Bill Spitzak wrote:
> On Sat, Sep 19, 2015 at 5:47 PM, John-John Tedro <johnjohn.tedro at gmail.com>
> wrote:
>
> > create_layout_transition does not initialize is_transition_func.
> >
> > This patch initializes it to NULL.
> >
> > Signed-off-by: John-John Tedro <johnjohn.tedro at gmail.com>
> > ---
> > ivi-shell/ivi-layout-transition.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/ivi-shell/ivi-layout-transition.c
> > b/ivi-shell/ivi-layout-transition.c
> > index d12a8f4..d45b332 100644
> > --- a/ivi-shell/ivi-layout-transition.c
> > +++ b/ivi-shell/ivi-layout-transition.c
> > @@ -251,6 +251,7 @@ create_layout_transition(void)
> >
> > transition->is_done = 0;
> >
> > + transition->is_transition_func = NULL;
> > transition->private_data = NULL;
> > transition->user_data = NULL;
> >
>
> Maybe this should be using xzalloc, that seems to be the standard method in
> Weston
Yikes,
It looks like create_move_resize_view_transition (and others?) returns
NULL on allocation failures, which is fed unchecked into
layout_transition_register.
This will cause it to end up in
layout->transitions->transition_list where it will cause all kinds of
problems.
More information about the wayland-devel
mailing list