From: František Dvořák Date: Fri, 13 Sep 2013 15:32:28 +0000 (+0200) Subject: Fix readLink(): readlink() doesn't add ending null character. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=bf3cb10b10c1cd68a550c4afded36d6f4b8bd5e7;p=dmlite-plugins-vfs-old.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; }