diff options
author | David Kalnischkies <david@kalnischkies.de> | 2018-08-22 09:54:07 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2018-08-29 17:50:31 +0200 |
commit | 55585d0f93de1a0e60858e594b1b3b46f4a0831f (patch) | |
tree | 292b52144c177b636fdc9fecb57f97e93dc71d73 /apt-pkg/deb/debmetaindex.cc | |
parent | 8e4893b1fade91b2c05e81fde72ec1ab39bb67bf (diff) |
Don't use invalid iterator in Fallback-Of handling
cppcheck reports: (error) Iterator 't' used after element has been erased.
The loop is actually fashioned to deal with this (not in the most
efficient way, but in simplest and speed isn't really a concern here)
IF this codepath had a "break" at the end… so I added one.
Note that the tests aren't failing before (and hopefully after) the
change as the undefined behavior we encounter is too stable.
Thanks: David Binderman for reporting
Diffstat (limited to 'apt-pkg/deb/debmetaindex.cc')
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 6cbed85a7..9c7c70784 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -1043,6 +1043,7 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ auto const tv = *t; mytargets.erase(t); mytargets.emplace_back(tv); + break; } if (Changed == false) break; |