From: Steinar H. Gunderson Date: Mon, 4 Mar 2019 08:12:31 +0000 (+0100) Subject: Fix a one-past-the-end access on Futatabi startup. X-Git-Tag: 1.8.3~23 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=7074d937649879a6f7ae1a812a207643ca63945c Fix a one-past-the-end access on Futatabi startup. Reported by Marcus Nilsen. --- diff --git a/shared/metrics.cpp b/shared/metrics.cpp index b2d0bbc..248da38 100644 --- a/shared/metrics.cpp +++ b/shared/metrics.cpp @@ -99,7 +99,7 @@ void Metrics::remove(const string &name, const vector> &lab // If this is the last metric with this name, remove the type as well. if (!((it != metrics.begin() && prev(it)->first.name == name) || - (it != metrics.end() && next(it)->first.name == name))) { + (it != metrics.end() && next(it) != metrics.end() && next(it)->first.name == name))) { types.erase(name); }