From 6f388ec39823d67a233e8ad7949077b9c9f36707 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 Dec 2008 23:19:37 +0100 Subject: * apt-inst/contrib/arfile.cc: - support members ending with '/' as well (thanks to Michal Cihr, closes: #500988) --- apt-inst/contrib/arfile.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-inst/contrib') diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index a1fb97b48..7c85f2e86 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -111,7 +111,7 @@ bool ARArchive::LoadHeaders() else { unsigned int I = sizeof(Head.Name) - 1; - for (; Head.Name[I] == ' '; I--); + for (; Head.Name[I] == ' ' || Head.Name[I] == '/'; I--); Memb->Name = string(Head.Name,I+1); } -- cgit v1.2.3 From 472e2c3aa9c8ea38c2b5f0639bdb09eadb7ffca4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Aug 2009 10:22:53 +0200 Subject: [apt-inst/contrib/arfile.cc] use sizeof instead strlen Patch from Marius Vollmer, thanks! (Closes: #504325) --- apt-inst/contrib/arfile.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-inst/contrib') diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 7c85f2e86..e6c63d1ab 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -96,7 +96,7 @@ bool ARArchive::LoadHeaders() char S[300]; unsigned long Len; if (StrToNum(Head.Name+3,Len,sizeof(Head.Size)-3) == false || - Len >= strlen(S)) + Len >= sizeof(S)) { delete Memb; return _error->Error(_("Invalid archive member header")); -- cgit v1.2.3 From 07b2db9b4b2e543b599db97d75ac2315a1676ad8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 24 Sep 2009 09:32:20 +0200 Subject: * apt-inst/contrib/arfile.cc: - show propper error message for Invalid archive members --- apt-inst/contrib/arfile.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-inst/contrib') diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 7c85f2e86..8f30355ed 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -87,7 +87,7 @@ bool ARArchive::LoadHeaders() StrToNum(Head.Size,Memb->Size,sizeof(Head.Size)) == false) { delete Memb; - return _error->Error(_("Invalid archive member header")); + return _error->Error(_("Invalid archive member header %s"), Head.Name); } // Check for an extra long name string -- cgit v1.2.3