file_sync_service: fix stack corruption 56/124856/1
authorSooyoung Ha <yoosah.ha@samsung.com>
Wed, 12 Apr 2017 17:02:20 +0000 (02:02 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Wed, 12 Apr 2017 17:12:48 +0000 (02:12 +0900)
Change-Id: I1e85ba0bc7f772e8f8446030ea4ea71cda2b48d5
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
src/file_sync_service.c

index 8b0b73c..d4d35eb 100644 (file)
@@ -220,7 +220,7 @@ static int do_list(int s, const char *path)
             continue;
         }
 
-        s_strncpy(fname, de->d_name, sizeof tmp);
+        s_strncpy(fname, de->d_name, len);
         if(lstat(tmp, &st) == 0) {
             msg.dent.mode = htoll(st.st_mode);
             msg.dent.size = htoll(st.st_size);