summaryrefslogtreecommitdiffstats
path: root/SystemInformation.cxx
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2017-10-10 12:43:01 (GMT)
committerBrad King <brad.king@kitware.com>2017-10-10 12:43:35 (GMT)
commitc551ff588b48cc4c286922779651890da0f3c22c (patch)
treedf0cfeab5a3ba3f8c41ade690b3ba27bb2c22477 /SystemInformation.cxx
parent4532b0357261af903f86bc29429ae3c9413b54ab (diff)
downloadCMake-c551ff588b48cc4c286922779651890da0f3c22c.zip
CMake-c551ff588b48cc4c286922779651890da0f3c22c.tar.gz
CMake-c551ff588b48cc4c286922779651890da0f3c22c.tar.bz2
KWSys 2017-10-10 (239bc737)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 239bc737543886a72c5e9e3445d51e17f7e26abe (master). Upstream Shortlog ----------------- Matthias Maennich (5): 6599eda6 testRobustEncoding: restore format flags for std::cout before exiting 862562ce SystemInformation: fix potential off-by-one write 13e02b76 processUNIX: close intermediate file descriptor in error case 73c491e8 processUNIX: fix not null terminated buffer during error reporting ce55a255 testSystemTools: fix some copy'n'paste issues Rolf Eike Beer (5): 6ca15069 SystemTools: make Getcwd() more efficient on Windows 6d7eb3a1 CommandLineArguments: do not check variable before delete[] 3b8fefea remove pointer checks before calling free() cf8beae3 ProcessUNIX: use strdup() instead of open coding it 5d2aff9d ProcessWin32: use strdup() instead of open coding it
Diffstat (limited to 'SystemInformation.cxx')
-rw-r--r--SystemInformation.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 86fdccd..366fe30 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -1346,7 +1346,7 @@ std::string SymbolProperties::GetBinary() const
std::string binary;
char buf[1024] = { '\0' };
ssize_t ll = 0;
- if ((ll = readlink("/proc/self/exe", buf, 1024)) > 0) {
+ if ((ll = readlink("/proc/self/exe", buf, 1024)) > 0 && ll < 1024) {
buf[ll] = '\0';
binary = buf;
} else {