On Wed, Jan 20, 2010 at 10:41 AM, Enlightenment SVN
<no-re...@enlightenment.org> wrote:
> Log:
>        * ecore: Handle NULL in ecore_file_dir_get.
>
> Author:       cedric
> Date:         2010-01-20 04:41:22 -0800 (Wed, 20 Jan 2010)
> New Revision: 45352
>
> Modified:
>  trunk/ecore/src/lib/ecore_file/ecore_file.c
>
> Modified: trunk/ecore/src/lib/ecore_file/ecore_file.c
> ===================================================================
> --- trunk/ecore/src/lib/ecore_file/ecore_file.c 2010-01-20 04:45:47 UTC (rev 
> 45351)
> +++ trunk/ecore/src/lib/ecore_file/ecore_file.c 2010-01-20 12:41:22 UTC (rev 
> 45352)
> @@ -600,6 +600,7 @@
>    char *p;
>    char buf[PATH_MAX];
>
> +   if (!file) return NULL;
>    strncpy(buf, file, PATH_MAX);
>    p = dirname(buf);
>    return strdup(p);

i know you did not change this code, but strncpy() is not safe (check
its man page about trailing \0), so it's better to use ecore_strlcpy()


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to