]> git.saurik.com Git - apt.git/commitdiff
fix progress-segfault in case of dpkg errors/prompts
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 13 Oct 2013 17:33:09 +0000 (19:33 +0200)
committerMichael Vogt <mvo@debian.org>
Mon, 14 Oct 2013 13:04:29 +0000 (15:04 +0200)
Errors and conffile prompts have a fourth information piece,
which the "old" code access which isn't provided by the "new" one.

This isn't checking if the messages are really well-formed,
so it could still segfault on misformed messages, but this code
needs more work anyway, so one step at a time.

Closes: 726047
apt-pkg/deb/dpkgpm.cc

index c29d21574cb7a2927fc920a00037c71d07ede7db..1fbeabbdcd9b6f0df98ef2321ae993d768312ff5 100644 (file)
@@ -546,8 +546,8 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line)
    // A dpkg error message may contain additional ":" (like
    //  "failed in buffer_write(fd) (10, ret=-1): backend dpkg-deb ..."
    // so we need to ensure to not split too much
-   std::vector<std::string> list = StringSplit(line, ": ", 3);
-   if(list.size() != 3)
+   std::vector<std::string> list = StringSplit(line, ": ", 4);
+   if(list.size() < 3)
    {
       if (Debug == true)
         std::clog << "ignoring line: not enough ':'" << std::endl;