On Mon, May 8, 2017 at 9:47 AM Minchul Lee <[email protected]> wrote:

> stefan pushed a commit to branch master.
>
>
> http://git.enlightenment.org/core/efl.git/commit/?id=82f0be9a3217eb13d70b15c014f56009297d593b
>
> commit 82f0be9a3217eb13d70b15c014f56009297d593b
> Author: Minchul Lee <[email protected]>
> Date:   Mon May 8 15:39:21 2017 +0200
>
>     edje: null checking the return value of a function eina_mempool_malloc
>
>     Summary:
>     The return value of the function eina_mempool_malloc was dereferenced
> without checking. I added the checking code similar to the other codes.
>     @fix
>
>     Reviewers: raster, cedric, jpeg, herdsman, woohyun, stefan_schmidt
>
>     Subscribers: stefan_schmidt
>
>     Differential Revision: https://phab.enlightenment.org/D4855
> ---
>  src/lib/edje/edje_calc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
> index 37163c3..ca3f851 100644
> --- a/src/lib/edje/edje_calc.c
> +++ b/src/lib/edje/edje_calc.c
> @@ -770,7 +770,8 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part
> *ep, const char *d1, doubl
>            {
>               ep->param2 = eina_mempool_malloc(_edje_real_part_state_mp,
>
>  sizeof(Edje_Real_Part_State));
> -             memset(ep->param2, 0, sizeof(Edje_Real_Part_State));
> +             if (ep->param2)
> +               memset(ep->param2, 0, sizeof(Edje_Real_Part_State));
>            }
>          else if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
>            {
>

Shouldn't this be eina_mempool_calloc() ?


> @@ -779,7 +780,8 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part
> *ep, const char *d1, doubl
>
> _edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object,
>
> ep->param2->external_params);
>            }
> -        ep->param2->external_params = NULL;
> +        if (ep->param2)
> +          ep->param2->external_params = NULL;
>       }
>     else
>     if (ep->param2)
>

And this should be moved into the block above?
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to