security check : null termination check 14/191414/2
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 17 Oct 2018 01:39:24 +0000 (10:39 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Thu, 18 Oct 2018 06:09:17 +0000 (06:09 +0000)
Change-Id: I047b7b4767b9d0c34919c870413a2634c0b4a8de

dali-toolkit/internal/builder/builder-filesystem.h [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index bbb77d7..d7118dd
@@ -46,7 +46,9 @@ inline std::string ExpandPath(const std::string &name)
 inline std::string ExePath(void)
 {
   char buf[256];
-  readlink("/proc/self/exe", buf, sizeof(buf));
+  ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
+  len = len > 0 ? len : 0;
+  buf[len] = '\0';
   return std::string(buf);
 }