Bug 1419004: Fix crash when setting plugin process names on macOS 10.13.2. r=mstange a=gchang
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Tue, 12 Dec 2017 17:03:33 -0600
changeset 445361 99e8736d4a20fa1b937346863a95bfac9531e73c
parent 445360 44c9c219f7a5849e88433dc1d627f5ddb77c89e3
child 445362 59058a3856b731ec0fc2955b11aa3dddb7ebeee4
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, gchang
bugs1419004
milestone58.0
Bug 1419004: Fix crash when setting plugin process names on macOS 10.13.2. r=mstange a=gchang
dom/plugins/ipc/PluginUtilsOSX.mm
--- a/dom/plugins/ipc/PluginUtilsOSX.mm
+++ b/dom/plugins/ipc/PluginUtilsOSX.mm
@@ -244,16 +244,21 @@ bool mozilla::plugins::PluginUtilsOSX::S
   if (!launchServices) {
     NS_WARNING("Failed to set process name: Could not open LaunchServices bundle");
     return false;
   }
 
   if (!sApplicationASN) {
     sApplicationASN = ::CFBundleGetFunctionPointerForName(launchServices, 
                                             CFSTR("_LSGetCurrentApplicationASN"));
+    if (!sApplicationASN) {
+      NS_WARNING("Failed to set process name: Could not get function pointer "
+                 "for LaunchServices");
+      return false;
+    }
   }
 
   LSGetASNType getASNFunc = reinterpret_cast<LSGetASNType>
                                           (sApplicationASN);
 
   if (!sApplicationInfoItem) {
     sApplicationInfoItem = ::CFBundleGetFunctionPointerForName(launchServices, 
                                             CFSTR("_LSSetApplicationInformationItem"));