From 6e1367259e0fa4511fe198946629d43189fe9b19 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Wed, 17 Oct 2018 10:39:24 +0900 Subject: [PATCH] [Tizen] security check : null termination check Change-Id: I047b7b4767b9d0c34919c870413a2634c0b4a8de --- dali-toolkit/internal/builder/builder-filesystem.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 dali-toolkit/internal/builder/builder-filesystem.h diff --git a/dali-toolkit/internal/builder/builder-filesystem.h b/dali-toolkit/internal/builder/builder-filesystem.h old mode 100644 new mode 100755 index bbb77d7..d7118dd --- a/dali-toolkit/internal/builder/builder-filesystem.h +++ b/dali-toolkit/internal/builder/builder-filesystem.h @@ -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); } -- 2.7.4