Skip to content

Commit

Permalink
Fix a possible heap corruption when no breakpoints are set
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Oct 10, 2022
1 parent ad22697 commit 4ac73f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ static bool cbMiniDump(int argc, char* argv[])
// Disable all software breakpoints
std::vector<duint> disabled_breakpoints;
{
BPMAP bplist;
BPMAP bplist = {};
DbgGetBpList(bp_normal, &bplist);
for (int i = 0; i < bplist.count; i++)
{
const auto& bp = bplist.bp[i];
if (bp.active && bp.enabled)
{
char cmd[256] = "";
sprintf_s(cmd, "bd 0x%p", bp.addr);
sprintf_s(cmd, "bd 0x%p", (void*)bp.addr);
if (DbgCmdExecDirect(cmd))
disabled_breakpoints.push_back(bp.addr);
}
Expand Down Expand Up @@ -90,7 +90,7 @@ static bool cbMiniDump(int argc, char* argv[])
for (auto addr : disabled_breakpoints)
{
char cmd[256] = "";
sprintf_s(cmd, "be 0x%p", addr);
sprintf_s(cmd, "be 0x%p", (void*)addr);
DbgCmdExecDirect(cmd);
}

Expand Down

0 comments on commit 4ac73f4

Please sign in to comment.