bug 1592875 - Add missing result check to avoid uninitialized memory access. draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Sat, 09 Nov 2019 11:12:03 +0900
changeset 81105 45fde53308e3661d72b4d19cf7ed707bffd6e27a
parent 81104 230fa4b32682cc499256e04bf8fd930b7aa88383
child 81106 125c78a2aa3ddbc56e0bcf7ab47d0da7f1767e10
push id9745
push userishikawa@yk.rim.or.jp
push dateSat, 09 Nov 2019 02:12:14 +0000
treeherdertry-comm-central@f62e5475decc [default view] [failures only]
bugs1592875
bug 1592875 - Add missing result check to avoid uninitialized memory access.
mozilla-M-C-000-add-missing-result-check.patch
new file mode 100644
--- /dev/null
+++ b/mozilla-M-C-000-add-missing-result-check.patch
@@ -0,0 +1,28 @@
+# HG changeset patch
+# User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
+# Parent  c65ef27b6fc78ec5140068913209bad3b55f1139
+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;
+   }
+