From 89287c7caeee7e085406f60f99bcc017f60634d8 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Sun, 28 Jun 2020 15:37:58 +0200 Subject: [PATCH] we have to guarantee this --- passphrase_cache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/passphrase_cache.cc b/passphrase_cache.cc index 6c71c61..210a94e 100644 --- a/passphrase_cache.cc +++ b/passphrase_cache.cc @@ -49,8 +49,10 @@ namespace pEp { { std::lock_guard lock(_mtx); - if (_cache.empty()) + if (_cache.empty()) { + _which = _cache.end(); throw std::underflow_error("empty passphrase cache"); + } if (_which == _cache.begin()) { _which = _cache.end();