]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
You have to do the bounds check before the access.
[apt.git] / methods / http.cc
index d5a00211fff5a0f8c8ef8f788e266c850f5895e1..8d3c569c1750946b0a42d358f3825b06436d9b17 100644 (file)
@@ -648,6 +648,9 @@ bool HttpServerState::RunData(FileFd * const File)
                                                                        /*}}}*/
 bool HttpServerState::RunDataToDevNull()                               /*{{{*/
 {
+   // no need to clean up if we discard the connection anyhow
+   if (Persistent == false)
+      return true;
    FileFd DevNull("/dev/null", FileFd::WriteOnly);
    return RunData(&DevNull);
 }