bug 1592875 - Add missing result check to avoid uninitialized memory access. draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Sat, 09 Nov 2019 11:00:43 +0900
changeset 81086 f72bf9c6c124c2d841130837c92639dbf5f94cad
parent 81085 da244c1a4acf98ce3cead0fc327688b7ad30acdb
child 81087 c55debdb82fafd6f572cd03431eb546cf2b528a4
push id9744
push userishikawa@yk.rim.or.jp
push dateSat, 09 Nov 2019 02:01:06 +0000
treeherdertry-comm-central@56c83244ac0e [default view] [failures only]
bugs1592875
bug 1592875 - Add missing result check to avoid uninitialized memory access.
mozilla-M-C-024-add-missing-result-check.patch
new file mode 100644
--- /dev/null
+++ b/mozilla-M-C-024-add-missing-result-check.patch
@@ -0,0 +1,28 @@
+# HG changeset patch
+# User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
+# Parent  7cc9c806841e784d7bbdbe4835aeafa57267ca25
+bug 1592875 - Add missing result check to avoid uninitialized memory access.
+
+diff --git a/dom/plugins/base/nsPluginTags.cpp b/dom/plugins/base/nsPluginTags.cpp
+--- a/dom/plugins/base/nsPluginTags.cpp
++++ b/dom/plugins/base/nsPluginTags.cpp
+@@ -514,17 +514,18 @@ nsPluginTag::GetClicktoplay(bool* aClick
+   return NS_OK;
+ }
+ 
+ NS_IMETHODIMP
+ nsPluginTag::GetEnabledState(uint32_t* aEnabledState) {
+   int32_t enabledState;
+   nsresult rv =
+       Preferences::GetInt(GetStatePrefNameForPlugin(this).get(), &enabledState);
+-  if (enabledState == nsIPluginTag::STATE_ENABLED && mIsFlashPlugin) {
++  if (NS_SUCCEEDED(rv) && enabledState == nsIPluginTag::STATE_ENABLED &&
++      mIsFlashPlugin) {
+     enabledState = nsIPluginTag::STATE_CLICKTOPLAY;
+   }
+   if (NS_SUCCEEDED(rv) && enabledState >= nsIPluginTag::STATE_DISABLED &&
+       enabledState <= nsIPluginTag::STATE_ENABLED) {
+     *aEnabledState = (uint32_t)enabledState;
+     return rv;
+   }
+