seoz pushed a commit to branch master.
commit cbcec392b29cf0df8a0329148f0a19283b5ce5c2
Author: Daniel Juyung Seo <[email protected]>
Date: Sat Jul 6 12:05:36 2013 +0900
test_panel.c: fixed derefence null return value from getenv issue which was
spotted by coverity. CID 1040025.
---
src/bin/test_panel.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/bin/test_panel.c b/src/bin/test_panel.c
index 39de33c..da6c38d 100644
--- a/src/bin/test_panel.c
+++ b/src/bin/test_panel.c
@@ -93,11 +93,14 @@ _fill_list(Evas_Object *obj)
struct dirent *de;
Eina_List *l;
char *real;
+ char *home_env = NULL;
unsigned int x = 0;
if (!dirs)
{
- if (!(d = opendir(getenv("HOME")))) return;
+ home_env = getenv("HOME");
+ if (!home_env) return;
+ if (!(d = opendir(home_env))) return;
while ((de = readdir(d)) && (x < LIST_ITEM_MAX))
{
char buff[PATH_MAX];
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev