From b68ce88357daf362e60d7f8f131041289c8db690 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 17 Mar 2014 13:43:12 +0100 Subject: apt-inst: Do not try to create a substring of an empty string in error reporting One of our compressors (the empty one) has an empty extension. Calling substr on it fails. --- apt-inst/deb/debfile.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt-inst') diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index 3803329fa..a63cb6716 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -124,8 +124,10 @@ bool debDebFile::ExtractTarMember(pkgDirStream &Stream,const char *Name) { std::string ext = std::string(Name) + ".{"; for (std::vector::const_iterator c = compressor.begin(); - c != compressor.end(); ++c) - ext.append(c->Extension.substr(1)); + c != compressor.end(); ++c) { + if (!c->Extension.empty()) + ext.append(c->Extension.substr(1)); + } ext.append("}"); return _error->Error(_("Internal error, could not locate member %s"), ext.c_str()); } -- cgit v1.2.3