[Lldb-commits] [PATCH] D31485: Verify memory address range validity in GDBRemoteCommunicationClient
Alex Langford via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 30 16:52:20 PDT 2017
xiaobai marked an inline comment as done.
xiaobai added inline comments.
================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:1506-1510
+ // We got an invalid address range back
+ if (!region_info.GetRange().IsValid()) {
+ error.SetErrorString("Server returned invalid range");
+ }
+
----------------
clayborg wrote:
> Logic is fine, but I would work this into the if statement below. Something like:
>
> ```
> if (region_info.GetRange().IsValid()) {
> if (!saw_permissions) {
> region_info.SetReadable(MemoryRegionInfo::eNo);
> region_info.SetWritable(MemoryRegionInfo::eNo);
> region_info.SetExecutable(MemoryRegionInfo::eNo);
> region_info.SetMapped(MemoryRegionInfo::eNo);
> }
> } else {
> // We got an invalid address range back
> error.SetErrorString("Server returned invalid range");
> }
> ```
Thanks for pointing that out!
https://reviews.llvm.org/D31485
More information about the lldb-commits
mailing list