On Wed, Sep 21, 2016 at 3:04 AM, ChunEon Park <her...@hermet.pe.kr> wrote:
> hermet pushed a commit to branch master.
>
> http://git.enlightenment.org/core/efl.git/commit/?id=06bd8dcf330fe31891475c92aa340d4886f47e2b
>
> commit 06bd8dcf330fe31891475c92aa340d4886f47e2b
> Author: Hermet Park <her...@hermet.pe.kr>
> Date:   Wed Sep 21 15:03:11 2016 +0900
>
>     edje edje_embryo: use strncpy().
>
>     This change is not meaningful but avoids an annoying coverity detection.
> ---
>  src/lib/edje/edje_embryo.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
> index bb46310..c09c3ff 100644
> --- a/src/lib/edje/edje_embryo.c
> +++ b/src/lib/edje/edje_embryo.c
> @@ -1553,10 +1553,9 @@ _edje_embryo_fn_get_text(Embryo_Program *ep, 
> Embryo_Cell *params)
>            }
>          else
>            {
> -             char *ss;
> -
> -             ss = alloca(strlen(s) + 1);
> -             strcpy(ss, s);
> +             int size = strlen(s) + 1;
> +             char *ss = alloca(size);
> +             strncpy(ss, s, size);


strlcpy(), but really, just dismiss this one in covertity... is it
dumb? We're alloca(strlen(s) + 1), how would it fail the size?

alternatively you can replace this with memcpy(ss, s, size), at least
it's faster.

------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to