[Lldb-commits] [PATCH] D143012: Add a bit of error checking to SBProcess::ReadMemory to check if a nullptr destination buffer was provided, return error

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 6 15:33:00 PST 2023


mib accepted this revision.
mib added a comment.

LGTM with @JDevlieghere comments.



================
Comment at: lldb/source/API/SBProcess.cpp:807-811
+  if (!dst) {
+    sb_error.SetErrorStringWithFormat(
+        "no buffer provided to read %zu bytes into", dst_len);
+    return 0;
+  }
----------------
JDevlieghere wrote:
> Nit: this isn't using `bytes_read` so I'd move the new code above it.
+1


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143012/new/

https://reviews.llvm.org/D143012



More information about the lldb-commits mailing list