diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit.mm b/media/webrtc/trunk/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit.mm index 8e0b00273..f82437842 100644 --- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit.mm +++ b/media/webrtc/trunk/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit.mm @@ -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 diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/mac/quicktime/video_capture_quick_time.cc b/media/webrtc/trunk/webrtc/modules/video_capture/mac/quicktime/video_capture_quick_time.cc index 0a140de48..509e2541b 100644 --- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/quicktime/video_capture_quick_time.cc +++ b/media/webrtc/trunk/webrtc/modules/video_capture/mac/quicktime/video_capture_quick_time.cc @@ -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 diff --git a/media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.cc b/media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.cc index 0c0b69f1c..18a0446fe 100644 --- a/media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.cc +++ b/media/webrtc/trunk/webrtc/video_engine/desktop_capture_impl.cc @@ -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); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index a7ace746c..95c2fc9f3 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -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 diff --git a/storage/TelemetryVFS.cpp b/storage/TelemetryVFS.cpp index aad401192..74531aa11 100644 --- a/storage/TelemetryVFS.cpp +++ b/storage/TelemetryVFS.cpp @@ -279,26 +279,33 @@ DatabasePathFromWALPath(const char *zWALName) MOZ_CRASH("Should never get here!"); } -already_AddRefed -GetQuotaObjectFromNameAndParameters(const char *zName, - const char *zURIParameterKey) -{ - MOZ_ASSERT(zName); - MOZ_ASSERT(zURIParameterKey); +already_AddRefed 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; 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);