From 379e22a4c0c00193b16fec3c46c4b68cdb63ee1a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 11 Feb 2012 21:25:57 +0100 Subject: [PATCH] remove the arbitrary MAXLEN limit for response lines (Closes: #658346) --- debian/changelog | 3 ++- methods/http.cc | 4 ---- methods/http.h | 4 +--- methods/https.h | 2 -- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8e66fd2fd..0a366a6fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low - if a file without an extension is requested send an 'Accept: text/*' header to avoid that the server chooses unsupported compressed files in a content-negotation attempt (Closes: #657560) + - remove the arbitrary MAXLEN limit for response lines (Closes: #658346) * apt-pkg/aptconfiguration.cc: - chroot if needed before calling dpkg --print-foreign-architectures - ensure that architectures are not added multiple times @@ -44,7 +45,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode - -- David Kalnischkies Sat, 11 Feb 2012 20:59:13 +0100 + -- David Kalnischkies Sat, 11 Feb 2012 21:23:00 +0100 apt (0.8.16~exp12) experimental; urgency=low diff --git a/methods/http.cc b/methods/http.cc index 2721b1224..7ddf8e045 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -534,10 +534,6 @@ bool ServerState::HeaderLine(string Line) if (Line.empty() == true) return true; - // The http server might be trying to do something evil. - if (Line.length() >= MAXLEN) - return _error->Error(_("Got a single header line over %u chars"),MAXLEN); - string::size_type Pos = Line.find(' '); if (Pos == string::npos || Pos+1 > Line.length()) { diff --git a/methods/http.h b/methods/http.h index c73d4df5c..c061ad680 100644 --- a/methods/http.h +++ b/methods/http.h @@ -11,8 +11,6 @@ #ifndef APT_HTTP_H #define APT_HTTP_H -#define MAXLEN 360 - #include #include @@ -92,7 +90,7 @@ struct ServerState unsigned int Major; unsigned int Minor; unsigned int Result; - char Code[MAXLEN]; + char Code[360]; // These are some statistics from the last parsed header lines unsigned long long Size; diff --git a/methods/https.h b/methods/https.h index b7adeb880..3b57c7be6 100644 --- a/methods/https.h +++ b/methods/https.h @@ -11,8 +11,6 @@ #ifndef APT_HTTP_H #define APT_HTTP_H -#define MAXLEN 360 - #include #include -- 2.45.2