Changeset 104493 in vbox
- Timestamp:
- May 2, 2024 4:45:44 PM (7 months ago)
- Location:
- trunk/src/libs/xpcom18a4/xpcom/components
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp
r103505 r104493 695 695 mStaticComponentLoader(0), 696 696 #endif 697 mComponentsOffset(0), 698 mGREComponentsOffset(0), 697 699 mShuttingDown(NS_SHUTDOWN_NEVERHAPPENED), 698 700 mLoaderData(nsnull), 701 mNLoaderData(0), 702 mMaxNLoaderData(0), 699 703 mRegistryDirty(PR_FALSE) 700 704 { … … 1048 1052 return NS_ERROR_FAILURE; 1049 1053 1050 uint64_t fileSize;1051 vrc = RTFileQuerySize(hFile, & fileSize);1054 uint64_t cbFile; 1055 vrc = RTFileQuerySize(hFile, &cbFile); 1052 1056 if (RT_FAILURE(vrc)) 1053 1057 { … … 1056 1060 } 1057 1061 1058 PRInt32 flen = nsInt64((PRInt64)fileSize); 1059 if (flen == 0) 1062 if (cbFile == 0) 1060 1063 { 1061 1064 RTFileClose(hFile); … … 1064 1067 } 1065 1068 1066 char* registry = new char[flen+1]; 1069 /* Some arbitrary upper limit we should never reach. */ 1070 if (cbFile > 128 * _1M) 1071 { 1072 RTFileClose(hFile); 1073 NS_WARNING("Persistent Registry too large!"); 1074 return NS_ERROR_FAILURE; 1075 } 1076 1077 char* registry = new char[cbFile+1]; 1067 1078 if (!registry) 1068 1079 goto out; 1069 1080 1070 vrc = RTFileRead(hFile, registry, flen, &cbRead);1071 if (RT_FAILURE(vrc) || cbRead < flen)1081 vrc = RTFileRead(hFile, registry, cbFile, &cbRead); 1082 if (RT_FAILURE(vrc) || cbRead < cbFile) 1072 1083 { 1073 1084 rv = NS_ERROR_FAILURE; 1074 1085 goto out; 1075 1086 } 1076 registry[ flen] = '\0';1077 1078 reader.Init(registry, flen);1087 registry[cbFile] = '\0'; 1088 1089 reader.Init(registry, (PRUint32)cbFile); 1079 1090 1080 1091 if (ReadSectionHeader(reader, "HEADER")) … … 2609 2620 2610 2621 entry = new (mem) nsFactoryEntry(aClass, aFactory, entry); 2611 2612 if (!entry)2613 return NS_ERROR_OUT_OF_MEMORY;2622 /* The following will never be true as we pass an already allocated memory buffer into new. */ 2623 //if (!entry) 2624 // return NS_ERROR_OUT_OF_MEMORY; 2614 2625 2615 2626 factoryTableEntry->mFactoryEntry = entry; … … 2767 2778 aRegistryName, aRegistryNameLen, 2768 2779 typeIndex); 2769 if (!entry) 2770 return NS_ERROR_OUT_OF_MEMORY; 2780 /* The following will never be true as we pass an already allocated memory buffer into new. */ 2781 //if (!entry) 2782 // return NS_ERROR_OUT_OF_MEMORY; 2771 2783 2772 2784 nsFactoryTableEntry* factoryTableEntry = -
trunk/src/libs/xpcom18a4/xpcom/components/nsNativeComponentLoader.cpp
r102458 r104493 208 208 || RTStrICmp(leafName.get() + (leafName.Length() - sizeof(".dSYM") + 1), ".dSYM")) 209 209 #endif 210 rv =RegisterComponentsInDir(when, dirEntry);210 RegisterComponentsInDir(when, dirEntry); 211 211 } 212 212 else … … 214 214 PRBool registered; 215 215 // This is a file. Try to register it. 216 rv =AutoRegisterComponent(when, dirEntry, ®istered);216 AutoRegisterComponent(when, dirEntry, ®istered); 217 217 } 218 218 } … … 836 836 } 837 837 838 dll = new nsDll(spec, this); 838 839 if (!dll) 839 { 840 dll = new nsDll(spec, this); 841 if (!dll) 842 return NS_ERROR_OUT_OF_MEMORY; 843 } 840 return NS_ERROR_OUT_OF_MEMORY; 844 841 845 842 *aDll = dll;
Note:
See TracChangeset
for help on using the changeset viewer.