git://scientific.zcu.cz
/
dmlite-plugins-vfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
263e853
)
Fix readLink(): readlink() doesn't add ending null character.
author
František Dvořák
<valtri@civ.zcu.cz>
Thu, 10 Oct 2013 12:44:13 +0000
(14:44 +0200)
committer
František Dvořák
<valtri@civ.zcu.cz>
Thu, 10 Oct 2013 12:44:13 +0000
(14:44 +0200)
src/VfsNs.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/VfsNs.cpp
b/src/VfsNs.cpp
index
a6ff7bf
..
a620b06
100644
(file)
--- 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;
}