summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/contrib/fileutl.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 928a1065a..162ad7e8d 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -922,7 +922,7 @@ bool ChangeOwnerAndPermissionOfFile(char const * const requester, char const * c
class APT_HIDDEN FileFdPrivate { /*{{{*/
protected:
FileFd * const filefd;
- size_t buffersize_max = 0;
+ const size_t buffersize_max = 4096;
std::unique_ptr<char[]> buffer;
unsigned long long buffersize = 0;
public:
@@ -984,8 +984,7 @@ public:
{
if (buffer.get() == nullptr)
{
- buffer.reset(new char[Size]);
- buffersize_max = Size;
+ buffer.reset(new char[buffersize_max]);
}
unsigned long long actualread = 0;
if (filefd->Read(buffer.get(), buffersize_max, &actualread) == false)
@@ -994,7 +993,6 @@ public:
if (buffersize == 0)
{
buffer.reset(nullptr);
- buffersize_max = 0;
if (To == InitialTo)
return nullptr;
break;