[Lldb-commits] [lldb] r251584 - Static analyzer noticed that a null get_pending_items_caller could

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 28 17:08:03 PDT 2015


Author: jmolenda
Date: Wed Oct 28 19:08:03 2015
New Revision: 251584

URL: http://llvm.org/viewvc/llvm-project?rev=251584&view=rev
Log:
Static analyzer noticed that a null get_pending_items_caller could
be used.  Guard against that.

Modified:
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp

Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp?rev=251584&r1=251583&r2=251584&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp (original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp Wed Oct 28 19:08:03 2015
@@ -178,7 +178,6 @@ AppleGetPendingItemsHandler::SetupGetPen
             {
                 if (log)
                     log->Printf("No pending-items introspection code found.");
-                errors.Printf ("No pending-items introspection code found.");
                 return LLDB_INVALID_ADDRESS;
             }
             
@@ -202,6 +201,13 @@ AppleGetPendingItemsHandler::SetupGetPen
     
     errors.Clear();
     
+    if (get_pending_items_caller == nullptr)
+    {
+        if (log)
+            log->Printf ("Failed to get get_pending_items_caller.");
+        return LLDB_INVALID_ADDRESS;
+    }
+    
     // Now write down the argument values for this particular call.  This looks like it might be a race condition
     // if other threads were calling into here, but actually it isn't because we allocate a new args structure for
     // this call by passing args_addr = LLDB_INVALID_ADDRESS...




More information about the lldb-commits mailing list