Skip to content

Commit

Permalink
Fixed long-standing old bug
Browse files Browse the repository at this point in the history
  • Loading branch information
insomniacslk committed Jul 2, 2017
1 parent 6d4f16f commit fdb099b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/traceroute_results.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ std::shared_ptr<IP> TracerouteResults::match_packet(const Packet &packet) {
// Try to match the received packet against the sent packets. The flow
// is identified by the UDP destination port
auto flow_id = inner_udp.dport();
// FIXME this can throw std::out_of_range
hops_t hops(flows().at(flow_id));
hops_t hops;
try {
hops = flows().at(flow_id);
} catch (std::out_of_range) {
return nullptr;
}

unsigned int index = 0;
for (auto &hop: *hops) {
Expand Down

0 comments on commit fdb099b

Please sign in to comment.