diff --git a/src/cryfs/cli/program_options/utils.cpp b/src/cryfs/cli/program_options/utils.cpp index 2c2f0d2d..4ea052f9 100644 --- a/src/cryfs/cli/program_options/utils.cpp +++ b/src/cryfs/cli/program_options/utils.cpp @@ -15,7 +15,9 @@ namespace cryfs { vector afterDoubleDash; afterDoubleDash.reserve(options.size()-beforeDoubleDash.size()+1); afterDoubleDash.push_back(options[0]); - std::copy(doubleDashIterator+1, options.end(), std::back_inserter(afterDoubleDash)); + if (options.end() >= doubleDashIterator+1) { + std::copy(doubleDashIterator + 1, options.end(), std::back_inserter(afterDoubleDash)); + } return make_pair( beforeDoubleDash, afterDoubleDash