From: František Dvořák Date: Thu, 10 Oct 2013 12:44:13 +0000 (+0200) Subject: Fix readLink(): readlink() doesn't add ending null character. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=2288801e71a3754ab3e61998fd6383305f8d795a;p=dmlite-plugins-vfs.git Fix readLink(): readlink() doesn't add ending null character. --- diff --git a/src/VfsNs.cpp b/src/VfsNs.cpp index a6ff7bf..a620b06 100644 --- a/src/VfsNs.cpp +++ b/src/VfsNs.cpp @@ -192,7 +192,9 @@ void VfsCatalog::symlink(const std::string& oldpath, const std::string& newpath) std::string VfsCatalog::readLink(const std::string& path) throw (DmException) { char buf[PATH_MAX]; - wrapCall(readlink(path.c_str(), buf, sizeof(buf))); + + memset(buf, 0, sizeof(buf)); + wrapCall(readlink(path.c_str(), buf, sizeof(buf) - 1)); return buf; }