#587: M1598543 M1607902 disable remote jars

This commit is contained in:
Cameron Kaiser 2020-02-07 20:23:59 -08:00
parent cc2e336b2f
commit cfb4b1e08a
5 changed files with 27 additions and 36 deletions

View File

@ -83,7 +83,7 @@ int32_t VideoCaptureMacQTKit::Init(
const int32_t nameLength =
(int32_t) strlen((char*)iDeviceUniqueIdUTF8);
if(nameLength>kVideoCaptureUniqueNameLength)
if(nameLength >= kVideoCaptureUniqueNameLength)
return -1;
// Store the device name

View File

@ -73,7 +73,7 @@ int32_t VideoCaptureMacQuickTime::Init(
const int32_t nameLength =
(int32_t) strlen((char*) deviceUniqueIdUTF8);
if (nameLength > kVideoCaptureUniqueNameLength)
if (nameLength >= kVideoCaptureUniqueNameLength)
return -1;
// Store the device name

View File

@ -80,7 +80,7 @@ int32_t ScreenDeviceInfoImpl::GetDeviceName(uint32_t deviceNumber,
const char *deviceName = desktopDisplayDevice.getDeviceName();
len = deviceName ? strlen(deviceName) : 0;
if (len && deviceNameUTF8 && len <= deviceNameUTF8Length) {
if (len && deviceNameUTF8 && len < deviceNameUTF8Length) {
memcpy(deviceNameUTF8,
deviceName,
len);
@ -88,7 +88,7 @@ int32_t ScreenDeviceInfoImpl::GetDeviceName(uint32_t deviceNumber,
const char *deviceUniqueId = desktopDisplayDevice.getUniqueIdName();
len = deviceUniqueId ? strlen(deviceUniqueId) : 0;
if (len && deviceUniqueIdUTF8 && len <= deviceUniqueIdUTF8Length) {
if (len && deviceUniqueIdUTF8 && len < deviceUniqueIdUTF8Length) {
memcpy(deviceUniqueIdUTF8,
deviceUniqueId,
len);
@ -174,13 +174,13 @@ int32_t AppDeviceInfoImpl::GetDeviceName(uint32_t deviceNumber,
const char *deviceName = desktopApplication.getProcessAppName();
len = deviceName ? strlen(deviceName) : 0;
if (len && len <= deviceNameUTF8Length) {
if (len && len < deviceNameUTF8Length) {
memcpy(deviceNameUTF8, deviceName, len);
}
const char *deviceUniqueId = desktopApplication.getUniqueIdName();
len = deviceUniqueId ? strlen(deviceUniqueId) : 0;
if (len && deviceUniqueIdUTF8 && len <= deviceUniqueIdUTF8Length) {
if (len && deviceUniqueIdUTF8 && len < deviceUniqueIdUTF8Length) {
memcpy(deviceUniqueIdUTF8,
deviceUniqueId,
len);
@ -276,7 +276,7 @@ int32_t WindowDeviceInfoImpl::GetDeviceName(uint32_t deviceNumber,
const char *deviceName = desktopDisplayDevice.getDeviceName();
len = deviceName ? strlen(deviceName) : 0;
if (len && deviceNameUTF8 && len <= deviceNameUTF8Length) {
if (len && deviceNameUTF8 && len < deviceNameUTF8Length) {
memcpy(deviceNameUTF8,
deviceName,
len);
@ -284,7 +284,7 @@ int32_t WindowDeviceInfoImpl::GetDeviceName(uint32_t deviceNumber,
const char *deviceUniqueId = desktopDisplayDevice.getUniqueIdName();
len = deviceUniqueId ? strlen(deviceUniqueId) : 0;
if (len && deviceUniqueIdUTF8 && len <= deviceUniqueIdUTF8Length) {
if (len && deviceUniqueIdUTF8 && len < deviceUniqueIdUTF8Length) {
memcpy(deviceUniqueIdUTF8,
deviceUniqueId,
len);

View File

@ -1523,12 +1523,8 @@ pref("dom.server-events.default-reconnection-time", 5000); // in milliseconds
// by the jar channel.
pref("network.jar.open-unsafe-types", false);
// If true, loading remote JAR files using the jar: protocol will be prevented.
#ifdef RELEASE_BUILD
// Keep allowing remote JAR files for IBM iNotes (see bug 1255139) for now.
// See also bug 1255139 if you have issues with Lotus Notes.
pref("network.jar.block-remote-files", false);
#else
pref("network.jar.block-remote-files", true);
#endif
// This preference, if true, causes all UTF-8 domain names to be normalized to
// punycode. The intention is to allow UTF-8 domain names as input, but never

View File

@ -279,26 +279,33 @@ DatabasePathFromWALPath(const char *zWALName)
MOZ_CRASH("Should never get here!");
}
already_AddRefed<QuotaObject>
GetQuotaObjectFromNameAndParameters(const char *zName,
const char *zURIParameterKey)
{
MOZ_ASSERT(zName);
MOZ_ASSERT(zURIParameterKey);
already_AddRefed<QuotaObject> GetQuotaObjectFromName(const char *zName,
bool deriveFromWal) {
// From Sqlite 3.31.0 the zName format changed to work consistently across
// database, wal and journal names.
// We must support both ways because this code will be uplifted to ensure
// that if system Sqlite is upgraded before us, we keep working properly.
// Once the Firefox minimum Sqlite version is 3.31.0, we can remove the else
// branch, DatabasePathFromWALPath, and the deriveFromWal argument.
const char* filename = zName;
if (deriveFromWal && sqlite3_libversion_number() < 3031000) {
filename = DatabasePathFromWALPath(zName);
}
MOZ_ASSERT(filename);
const char *persistenceType =
sqlite3_uri_parameter(zURIParameterKey, "persistenceType");
sqlite3_uri_parameter(filename, "persistenceType");
if (!persistenceType) {
return nullptr;
}
const char *group = sqlite3_uri_parameter(zURIParameterKey, "group");
const char *group = sqlite3_uri_parameter(filename, "group");
if (!group) {
NS_WARNING("SQLite URI had 'persistenceType' but not 'group'?!");
return nullptr;
}
const char *origin = sqlite3_uri_parameter(zURIParameterKey, "origin");
const char *origin = sqlite3_uri_parameter(filename, "origin");
if (!origin) {
NS_WARNING("SQLite URI had 'persistenceType' and 'group' but not "
"'origin'?!");
@ -327,16 +334,7 @@ MaybeEstablishQuotaControl(const char *zName,
return;
}
MOZ_ASSERT(zName);
const char *zURIParameterKey = (flags & SQLITE_OPEN_WAL) ?
DatabasePathFromWALPath(zName) :
zName;
MOZ_ASSERT(zURIParameterKey);
pFile->quotaObject =
GetQuotaObjectFromNameAndParameters(zName, zURIParameterKey);
pFile->quotaObject = GetQuotaObjectFromName(zName, flags & SQLITE_OPEN_WAL);
}
/*
@ -709,10 +707,7 @@ xDelete(sqlite3_vfs* vfs, const char *zName, int syncDir)
RefPtr<QuotaObject> quotaObject;
if (StringEndsWith(nsDependentCString(zName), NS_LITERAL_CSTRING("-wal"))) {
const char *zURIParameterKey = DatabasePathFromWALPath(zName);
MOZ_ASSERT(zURIParameterKey);
quotaObject = GetQuotaObjectFromNameAndParameters(zName, zURIParameterKey);
quotaObject = GetQuotaObjectFromName(zName, true);
}
rc = orig_vfs->xDelete(orig_vfs, zName, syncDir);