Skip to content

Commit

Permalink
fix iterator usage
Browse files Browse the repository at this point in the history
  • Loading branch information
willamowius committed Nov 4, 2024
1 parent 077cb83 commit 60810db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Toolkit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -841,11 +841,15 @@ int Toolkit::ProxyCriterion::SelectRoutingMode(const Address & ip1, const Addres
} else {
// on different networks, use maximum proxying
iter = m_modeselection.find(bestMatchIP1);
int mode1 = iter->second.fromExternal; // no check, must exist
iter = m_modeselection.find(bestMatchIP2);
int mode2 = iter->second.fromExternal; // no check, must exist
mode = max(mode1, mode2);
PTRACE(5, "ModeSelection: Both IPs on different networks: mode1=" << mode1 << " mode2=" << mode2 << " => " << mode);
if (iter != m_modeselection.end()) { // must exist
int mode1 = iter->second.fromExternal;
iter = m_modeselection.find(bestMatchIP2);
if (iter != m_modeselection.end()) { // must exist
int mode2 = iter->second.fromExternal;
mode = max(mode1, mode2);
PTRACE(5, "ModeSelection: Both IPs on different networks: mode1=" << mode1 << " mode2=" << mode2 << " => " << mode);
}
}
}
} else {
// only one rule, use that
Expand Down
1 change: 1 addition & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Changes from 5.13 to 5.14
=========================
- BUGFIX(Toolkit.cxx) fix iterator usage (found by Coverity)

Changes from 5.12 to 5.13
=========================
Expand Down

0 comments on commit 60810db

Please sign in to comment.