summaryrefslogtreecommitdiff
path: root/methods/basehttp.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2021-02-09 09:38:48 +0000
committerJulian Andres Klode <jak@debian.org>2021-02-09 09:38:48 +0000
commitcb60beb83610783f664da0bbe1cdb7211aaba90f (patch)
treea594f98222c256e6cec1a97c87305083823f0c91 /methods/basehttp.cc
parent4c3383746f2974be5fdec86616f45fd85948a9aa (diff)
parent131d0e3a261076da715102cb79275988cac810d1 (diff)
Merge branch 'pu/fuzzerpatches' into 'master'
Various patches uplifted from unfinished fuzzer branches See merge request apt-team/apt!158
Diffstat (limited to 'methods/basehttp.cc')
-rw-r--r--methods/basehttp.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/methods/basehttp.cc b/methods/basehttp.cc
index 8aac1090c..3786e2e6c 100644
--- a/methods/basehttp.cc
+++ b/methods/basehttp.cc
@@ -110,6 +110,9 @@ bool RequestState::HeaderLine(string const &Line) /*{{{*/
if (sscanf(Line.c_str(),"HTTP %3u%359[^\n]",&Result,Code) != 2)
return _error->Error(_("The HTTP server sent an invalid reply header"));
}
+ auto const CodeLen = strlen(Code);
+ auto const CodeEnd = std::remove_if(Code, Code + CodeLen, [](char c) { return isprint(c) == 0; });
+ *CodeEnd = '\0';
/* Check the HTTP response header to get the default persistence
state. */
@@ -762,7 +765,9 @@ int BaseHttpMethod::Loop()
// yes, he did! Disable pipelining and rewrite queue
if (Server->Pipeline == true)
{
- Warning(_("Automatically disabled %s due to incorrect response from server/proxy. (man 5 apt.conf)"), "Acquire::http::Pipeline-Depth");
+ std::string msg;
+ strprintf(msg, _("Automatically disabled %s due to incorrect response from server/proxy. (man 5 apt.conf)"), "Acquire::http::Pipeline-Depth");
+ Warning(std::move(msg));
Server->Pipeline = false;
Server->PipelineAllowed = false;
// we keep the PipelineDepth value so that the rest of the queue can be fixed up as well