[Lldb-commits] [lldb] [lldb] Avoid null dereference probing FreeBSD kernels (PR #223590)

via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 14 20:20:22 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Minsoo Choo (mchoo7)

<details>
<summary>Changes</summary>

Fixes: b3cc4804d45d6b612ac9b3cc47ebbb0da44ebc60

---
Full diff: https://github.com/llvm/llvm-project/pull/223590.diff


1 Files Affected:

- (modified) lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp (+6-2) 


``````````diff
diff --git a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
index ffda99cfcc736..9a736c649fcc5 100644
--- a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
@@ -181,10 +181,14 @@ bool DynamicLoaderFreeBSDKernel::ReadELFHeader(Process *process,
 lldb_private::UUID DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress(
     Process *process, lldb::addr_t addr, bool *read_error) {
   Log *log = GetLog(LLDBLog::DynamicLoader);
+  bool local_read_error;
+
+  if (!read_error)
+    read_error = &local_read_error;
+  *read_error = false;
 
   if (addr == LLDB_INVALID_ADDRESS) {
-    if (read_error)
-      *read_error = true;
+    *read_error = true;
     return UUID();
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/223590


More information about the lldb-commits mailing list