On Thu, Mar 19, 2015 at 4:55 PM, Cedric BAIL <[email protected]> wrote:

> On Thu, Mar 19, 2015 at 8:45 AM, Jaeun Choi <[email protected]>
> wrote:
> > eunue pushed a commit to branch master.
> >
> >
> http://git.enlightenment.org/core/efl.git/commit/?id=3cd2801be7ade3a347c2d9ca73df48d133f66c22
> >
> > commit 3cd2801be7ade3a347c2d9ca73df48d133f66c22
> > Author: Jaeun Choi <[email protected]>
> > Date:   Thu Mar 19 16:15:20 2015 +0900
> >
> >     eina: safety check for NULL pointer
> >
> >     data should not be NULL. it is used as the source of memcpy.
> >
> >     @fix
>
> Hum, I am not sure if that is the right fix. Somebody could argue that
> an empty file is a valid use case here. Maybe it would be good to
> handle it that way and add a test case for it explicitly in our tests
> suite.
>

Well, given the current situation a check is better than a crash :)
(immediate crash if copy is true).

If you are thinking of mapping /dev/zero instead, that could be another
approach.



>
> > ---
> >  src/lib/eina/eina_file_common.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/src/lib/eina/eina_file_common.c
> b/src/lib/eina/eina_file_common.c
> > index fe9ab20..05245318d 100644
> > --- a/src/lib/eina/eina_file_common.c
> > +++ b/src/lib/eina/eina_file_common.c
> > @@ -370,6 +370,8 @@ eina_file_virtualize(const char *virtual_name, const
> void *data, unsigned long l
> >     const char *tmpname = "/dev/mem/virtual\\/%16x";
> >     int slen;
> >
> > +   EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL);
> > +
> >     // Generate an almost uniq filename based on current nsec time.
> >     if (_eina_time_get(&tp)) return NULL;
> >     ti = _eina_time_convert(&tp);
> >
> > --
> >
> >
> >
>
>
>
> --
> Cedric BAIL
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
>


-- 
Jean-Philippe André
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to