diff options
author | Nobuhiro Hayashi <nobuhiro.hayashi@gmail.com> | 2010-12-03 12:09:09 +0900 |
---|---|---|
committer | Nobuhiro Hayashi <nobuhiro.hayashi@gmail.com> | 2010-12-03 12:09:09 +0900 |
commit | 54f2f0a3e46e4369285be8c25912fd45413114c0 (patch) | |
tree | 15db8bd5746fe42f23f86946eb4ca239ea2292e3 /apt-inst | |
parent | 4279ef3b0a35327a03955461fff3cd6821463457 (diff) | |
download | apt-54f2f0a3e46e4369285be8c25912fd45413114c0.tar.gz |
Permit base256 encoded value in the numeric field of tar header.
Diffstat (limited to 'apt-inst')
-rw-r--r-- | apt-inst/contrib/extracttar.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 3d2788aaf..1a358d57e 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -195,10 +195,14 @@ bool ExtractTar::Go(pkgDirStream &Stream) // Decode all of the fields pkgDirStream::Item Itm; if (StrToNum(Tar->Mode,Itm.Mode,sizeof(Tar->Mode),8) == false || - StrToNum(Tar->UserID,Itm.UID,sizeof(Tar->UserID),8) == false || - StrToNum(Tar->GroupID,Itm.GID,sizeof(Tar->GroupID),8) == false || - StrToNum(Tar->Size,Itm.Size,sizeof(Tar->Size),8) == false || - StrToNum(Tar->MTime,Itm.MTime,sizeof(Tar->MTime),8) == false || + (Base256ToNum(Tar->UserID,Itm.UID,8) == false && + StrToNum(Tar->UserID,Itm.UID,sizeof(Tar->UserID),8) == false) || + (Base256ToNum(Tar->GroupID,Itm.GID,8) == false && + StrToNum(Tar->GroupID,Itm.GID,sizeof(Tar->GroupID),8) == false) || + (Base256ToNum(Tar->Size,Itm.Size,12) == false && + StrToNum(Tar->Size,Itm.Size,sizeof(Tar->Size),8) == false) || + (Base256ToNum(Tar->MTime,Itm.MTime,12) == false && + StrToNum(Tar->MTime,Itm.MTime,sizeof(Tar->MTime),8) == false) || StrToNum(Tar->Major,Itm.Major,sizeof(Tar->Major),8) == false || StrToNum(Tar->Minor,Itm.Minor,sizeof(Tar->Minor),8) == false) return _error->Error(_("Corrupted archive")); |