From e5cbe2a60d56a8164f697f5f9b82fa7d937af099 Mon Sep 17 00:00:00 2001
From: James David Berry <jberry@apache.org>
Date: Mon, 26 Jan 2004 17:23:16 +0000
Subject: [PATCH] Add a check for a corner-case buffer condition

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175706 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp b/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp
index af04bc452..ef5615f20 100644
--- a/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp
+++ b/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp
@@ -825,7 +825,7 @@ XMLParsePathToFSRef_X(const XMLCh* const pathName, FSRef& ref, MemoryManager* co
 	
 	//	If it's a relative path, pre-pend the current directory to the path.
 	//	FSPathMakeRef doesn't deal with relativity on the front of the path
-	if (*p != '/')
+	if (*p != '/' && kMaxMacStaticPathChars > pathLen)
 	{
 		//	Right justify the user path to make room for the pre-pended path
 		std::memmove(p + kMaxMacStaticPathChars - pathLen, p, pathLen);
-- 
GitLab