Bug 1081906 - Fix unable to start Firefox due to 'Couldn't load XPCOM'. r=bsmedberg, a=sledru
authorMark Banner <standard8@mozilla.com>
Tue, 14 Oct 2014 10:06:20 +0100
changeset 223449 b5c326a2f65fecb82530d85eaead230821d10e60
parent 223448 34f6b3245d5dee7f88f18d0ef2f4711e77a84e57
child 223450 23962a888ef8ae3e8c81d7e68fd4ff25ffed6304
push id5
push usergszorc@mozilla.com
push dateWed, 29 Oct 2014 02:51:31 +0000
reviewersbsmedberg, sledru
bugs1081906
milestone35.0a2
Bug 1081906 - Fix unable to start Firefox due to 'Couldn't load XPCOM'. r=bsmedberg, a=sledru
xpcom/glue/standalone/nsXPCOMGlue.cpp
--- a/xpcom/glue/standalone/nsXPCOMGlue.cpp
+++ b/xpcom/glue/standalone/nsXPCOMGlue.cpp
@@ -376,16 +376,17 @@ XPCOMGlueLoad(const char* aXPCOMFile)
   // load the libraries from Contents/MacOS.
   const char *tempSlash = strrchr(aXPCOMFile, '/');
   size_t tempLen = size_t(tempSlash - aXPCOMFile);
   if (tempLen > MAXPATHLEN) {
     return nullptr;
   }
   char tempBuffer[MAXPATHLEN];
   memcpy(tempBuffer, aXPCOMFile, tempLen);
+  tempBuffer[tempLen] = '\0';
   const char *slash = strrchr(tempBuffer, '/');
   tempLen = size_t(slash - tempBuffer);
   const char *lastSlash = aXPCOMFile + tempLen;
 #else
   const char* lastSlash = strrchr(aXPCOMFile, '/');
 #endif
   char* cursor;
   if (lastSlash) {