diff options
Diffstat (limited to 'apt-inst')
-rw-r--r-- | apt-inst/contrib/arfile.cc | 11 | ||||
-rw-r--r-- | apt-inst/contrib/extracttar.cc | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 3fc3afedb..5cb43c690 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -92,7 +92,7 @@ bool ARArchive::LoadHeaders() StrToNum(Head.Size,Memb->Size,sizeof(Head.Size)) == false) { delete Memb; - return _error->Error(_("Invalid archive member header %s"), Head.Name); + return _error->Error(_("Invalid archive member header")); } // Check for an extra long name string @@ -119,7 +119,14 @@ bool ARArchive::LoadHeaders() else { unsigned int I = sizeof(Head.Name) - 1; - for (; Head.Name[I] == ' ' || Head.Name[I] == '/'; I--); + for (; Head.Name[I] == ' ' || Head.Name[I] == '/'; I--) + { + if (I == 0) + { + delete Memb; + return _error->Error(_("Invalid archive member header")); + } + } Memb->Name = std::string(Head.Name,I+1); } diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 42032ad13..19ac1c8b1 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -258,7 +258,7 @@ bool ExtractTar::Go(pkgDirStream &Stream) default: BadRecord = true; - _error->Warning(_("Unknown TAR header type %u, member %s"),(unsigned)Tar->LinkFlag,Tar->Name); + _error->Warning(_("Unknown TAR header type %u"), (unsigned)Tar->LinkFlag); break; } |