Hello, Attached is an updated patch for xerces-c-3.1.1-3. It has also been reported upstream for the 3.1.1 release: https://issues.apache.org/jira/browse/XERCESC-1998
The functions realpath and getcwd are already checked for in configure.ac/configure Thanks!
Index: xerces-c-3.1.1/src/xercesc/util/FileManagers/PosixFileMgr.cpp =================================================================== --- xerces-c-3.1.1.orig/src/xercesc/util/FileManagers/PosixFileMgr.cpp 2012-10-11 08:33:27.000000000 +0200 +++ xerces-c-3.1.1/src/xercesc/util/FileManagers/PosixFileMgr.cpp 2012-10-11 11:39:59.000000000 +0200 @@ -186,28 +186,28 @@ char* newSrc = XMLString::transcode(srcPath, manager); ArrayJanitor<char> janText(newSrc, manager); - // Use a local buffer that is big enough for the largest legal path - char absPath[PATH_MAX + 1]; - // get the absolute path - if (!realpath(newSrc, absPath)) + char *absPath = realpath(newSrc, NULL); + if (!absPath) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetBasePathName, manager); - - return XMLString::transcode(absPath, manager); + XMLCh *ret = XMLString::transcode(absPath, manager); + free(absPath); + return ret; } XMLCh* PosixFileMgr::getCurrentDirectory(MemoryManager* const manager) { - char dirBuf[PATH_MAX + 2]; - char *curDir = getcwd(&dirBuf[0], PATH_MAX + 1); + char *curDir = getcwd(NULL, 0); if (!curDir) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetBasePathName, manager); - return XMLString::transcode(curDir, manager); + XMLCh *ret = XMLString::transcode(curDir, manager); + free(curDir); + return ret; }