From: Sooyoung Ha Date: Wed, 12 Apr 2017 17:02:20 +0000 (+0900) Subject: file_sync_service: fix stack corruption X-Git-Tag: accepted/tizen/unified/20170413.160725~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F124856%2F1;p=sdk%2Ftarget%2Fsdbd.git file_sync_service: fix stack corruption Change-Id: I1e85ba0bc7f772e8f8446030ea4ea71cda2b48d5 Signed-off-by: Sooyoung Ha --- diff --git a/src/file_sync_service.c b/src/file_sync_service.c index 8b0b73c..d4d35eb 100644 --- a/src/file_sync_service.c +++ b/src/file_sync_service.c @@ -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);