Repository: qpid-cpp
Updated Branches:
  refs/heads/master dfb1f4306 -> 3a37ceed5


QPID-8184: Recovery intermittently produces JERR_EFP_BADEFPDIRNAME error 
followed by core: Fix by Pavel Moravec


Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/3a37ceed
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/3a37ceed
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/3a37ceed

Branch: refs/heads/master
Commit: 3a37ceed5faf667c6a0e45e023bb1d4fced66b75
Parents: dfb1f43
Author: Kim van der Riet <[email protected]>
Authored: Mon May 7 17:01:54 2018 -0400
Committer: Kim van der Riet <[email protected]>
Committed: Mon May 7 17:01:54 2018 -0400

----------------------------------------------------------------------
 src/qpid/linearstore/journal/RecoveryManager.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/3a37ceed/src/qpid/linearstore/journal/RecoveryManager.cpp
----------------------------------------------------------------------
diff --git a/src/qpid/linearstore/journal/RecoveryManager.cpp 
b/src/qpid/linearstore/journal/RecoveryManager.cpp
index 254566e..185fa00 100644
--- a/src/qpid/linearstore/journal/RecoveryManager.cpp
+++ b/src/qpid/linearstore/journal/RecoveryManager.cpp
@@ -392,12 +392,13 @@ void 
RecoveryManager::analyzeJournalFileHeaders(efpIdentity_t& efpIdentity) {
             // Read symlink, find efp directory name which is efp size in KiB
             // TODO: place this bit into a common function as it is also used 
in EmptyFilePool.cpp::deleteSymlink()
             char buff[1024];
-            ssize_t len = ::readlink((*i).c_str(), buff, 1024);
+            ssize_t len = ::readlink((*i).c_str(), buff, 1023);
             if (len < 0) {
                 std::ostringstream oss;
                 oss << "symlink=\"" << (*i) << "\"" << FORMAT_SYSERR(errno);
                 throw jexception(jerrno::JERR__SYMLINK, oss.str(), 
"RecoveryManager", "analyzeJournalFileHeaders");
             }
+            buff[len] = '\0'; // ::readlink() does not terminate the string
             // Find second and third '/' from back of string, which contains 
the EFP directory name
             *(::strrchr(buff, '/')) = '\0';
             *(::strrchr(buff, '/')) = '\0';


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to