summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-09-18 17:24:15 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-09-18 17:24:15 +0100
commitf26fcbc707e106946e18682f917ebd6f96444302 (patch)
treef1a5370d2693186e74a852edac0094e3fde1c45c /apt-pkg/deb
parent085bedacb04be4f805b0fb9d3b2a611d5d475d62 (diff)
- fix parse error when dpkg sends unexpected data
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/dpkgpm.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index ac63ccfdf..28b895ac7 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -392,14 +392,15 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line)
// statusfd or by rewriting the code here to deal with
// it. for now we just ignore it and not crash
TokSplitString(':', line, list, sizeof(list)/sizeof(list[0]));
- char *pkg = list[1];
- char *action = _strstrip(list[2]);
- if( pkg == NULL || action == NULL)
+ if( list[0] == NULL || list[1] == NULL || list[2] == NULL)
{
if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
std::clog << "ignoring line: not enough ':'" << std::endl;
return;
}
+ char *action = list[0];
+ char *pkg = list[1];
+ char *action = _strstrip(list[2]);
if(strncmp(action,"error",strlen("error")) == 0)
{