Bug 1242924 - check return of pattern.Init in DOMStorageManager::Observe. r=jst
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 26 Jan 2016 15:09:19 +0200
changeset 284383 b29b876744e3dc0388b32234a78f75280a445817
parent 284382 b85eae6c9a0582aa8bd92ec4adf4fea753ae539c
child 284384 b09f22c69916b7847306ec8757dc4ca14e5f560f
push id30003
push usercbook@mozilla.com
push dateWed, 17 Feb 2016 10:52:09 +0000
treeherdermozilla-central@15621f98b53b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs1242924
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1242924 - check return of pattern.Init in DOMStorageManager::Observe. r=jst
dom/storage/DOMStorageManager.cpp
--- a/dom/storage/DOMStorageManager.cpp
+++ b/dom/storage/DOMStorageManager.cpp
@@ -511,17 +511,20 @@ DOMStorageManager::ClearCaches(uint32_t 
 }
 
 nsresult
 DOMStorageManager::Observe(const char* aTopic,
                            const nsAString& aOriginAttributesPattern,
                            const nsACString& aOriginScope)
 {
   OriginAttributesPattern pattern;
-  pattern.Init(aOriginAttributesPattern);
+  if (!pattern.Init(aOriginAttributesPattern)) {
+    NS_ERROR("Cannot parse origin attributes pattern");
+    return NS_ERROR_FAILURE;
+  }
 
   // Clear everything, caches + database
   if (!strcmp(aTopic, "cookie-cleared")) {
     ClearCaches(DOMStorageCache::kUnloadComplete, pattern, EmptyCString());
     return NS_OK;
   }
 
   // Clear from caches everything that has been stored