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 225706 c212fd07fd32
parent 225705 5967c4a96835
child 225707 ae6317e02f72
push id3987
push userryanvm@gmail.com
push date2014-10-16 14:34 +0000
treeherdermozilla-beta@1f7f807b6362 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, sledru
bugs1081906
milestone34.0
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) {