From 7074d937649879a6f7ae1a812a207643ca63945c Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 4 Mar 2019 09:12:31 +0100 Subject: [PATCH] Fix a one-past-the-end access on Futatabi startup. Reported by Marcus Nilsen. --- shared/metrics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.39.2