X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4e3c5633b1e74b4f58b95f339cfbbf4cbf21ab3e..5f060c2776606f3166bd6c64119c31be8ba5d857:/methods/rred.cc diff --git a/methods/rred.cc b/methods/rred.cc index 85ec30bd5..79ab8cb52 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -491,7 +491,11 @@ class Patch { for (ch = filechanges.rbegin(); ch != filechanges.rend(); ++ch) { std::list::reverse_iterator mg_i, mg_e = ch; while (ch->del_cnt == 0 && ch->offset == 0) + { ++ch; + if (unlikely(ch == filechanges.rend())) + return; + } line -= ch->del_cnt; std::string buf; if (ch->add_cnt > 0) { @@ -656,6 +660,11 @@ class RredMethod : public aptMethod { out.Close(); inp.Close(); + if (_error->PendingError() == true) { + std::cerr << "FAILED to read or write files" << std::endl; + return false; + } + if (Debug == true) { std::clog << "rred: finished file patching of " << Path << "." << std::endl; }