source: fix readdir_r bug 85/63385/1
authorJinhyung Choi <jinh0.choi@samsung.com>
Wed, 23 Mar 2016 11:26:04 +0000 (20:26 +0900)
committerJinhyung Choi <jinh0.choi@samsung.com>
Wed, 23 Mar 2016 11:26:04 +0000 (20:26 +0900)
Change-Id: I3a3788d4370b3c44aa3c38c875fe019aeb1bb228
Signed-off-by: Jinhyung Choi <jinh0.choi@samsung.com>
src/emuld.cpp

index b03ba994fc05cd7cada30a5238f3dbd16f05fa75..a4b8da86ef048fd01478f955b81403f23ebd146f 100644 (file)
@@ -76,7 +76,7 @@ static void init_plugins(void)
         return;
     }
 
-    while ((!readdir_r(dirp, &entry, &dir_ent)))
+    while ((!readdir_r(dirp, &entry, &dir_ent)) && dir_ent)
     {
         snprintf(plugin_path, sizeof(plugin_path), "%s/%s", EMULD_PLUGIN_DIR, dir_ent->d_name);