[Lldb-commits] [lldb] [lldb] Adjust the for loop condition to prevent unintended increments in ExpandRLE (NFC) (PR #94844)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 10 00:53:35 PDT 2024
================
@@ -1316,6 +1316,7 @@ std::string GDBRemoteCommunication::ExpandRLE(std::string packet) {
} else {
decoded.push_back(*c);
}
+ c++;
----------------
labath wrote:
How does this prevent an out of bounds access? If I understand the problem correctly, the right fix to check for an almost-end iterator when doing the RLE expansion (change the condition to something like `if (*c == '*' && std::next(c) != packet.end())`, just less clumsy).
https://github.com/llvm/llvm-project/pull/94844
More information about the lldb-commits
mailing list