remove the arbitrary MAXLEN limit for response lines (Closes: #658346)
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 11 Feb 2012 20:25:57 +0000 (21:25 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 11 Feb 2012 20:25:57 +0000 (21:25 +0100)
debian/changelog
methods/http.cc
methods/http.h
methods/https.h

index 8e66fd2..0a366a6 100644 (file)
@@ -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 <kalnischkies@gmail.com>  Sat, 11 Feb 2012 20:59:13 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 11 Feb 2012 21:23:00 +0100
 
 apt (0.8.16~exp12) experimental; urgency=low
 
index 2721b12..7ddf8e0 100644 (file)
@@ -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())
    {
index c73d4df..c061ad6 100644 (file)
@@ -11,8 +11,6 @@
 #ifndef APT_HTTP_H
 #define APT_HTTP_H
 
-#define MAXLEN 360
-
 #include <apt-pkg/strutl.h>
 
 #include <string>
@@ -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;
index b7adeb8..3b57c7b 100644 (file)
@@ -11,8 +11,6 @@
 #ifndef APT_HTTP_H
 #define APT_HTTP_H
 
-#define MAXLEN 360
-
 #include <iostream>
 #include <curl/curl.h>