And as we are at it lets fix the 'style' issue I introduced with the
filefd changes as well.
Reported-By: gcc -fsanitize's & cppcheck
Git-Dch: Ignore
protected:
FileFd * const filefd;
size_t buffersize_max = 0;
protected:
FileFd * const filefd;
size_t buffersize_max = 0;
- std::unique_ptr<char> buffer;
+ std::unique_ptr<char[]> buffer;
unsigned long long buffersize = 0;
public:
int compressed_fd;
unsigned long long buffersize = 0;
public:
int compressed_fd;
APT::Configuration::Compressor compressor;
unsigned int openmode;
unsigned long long seekpos;
APT::Configuration::Compressor compressor;
unsigned int openmode;
unsigned long long seekpos;
- FileFdPrivate(FileFd * const pfilefd) : filefd(pfilefd), buffer(nullptr),
+ explicit FileFdPrivate(FileFd * const pfilefd) : filefd(pfilefd), buffer(nullptr),
compressed_fd(-1), compressor_pid(-1), is_pipe(false),
openmode(0), seekpos(0) {};
compressed_fd(-1), compressor_pid(-1), is_pipe(false),
openmode(0), seekpos(0) {};
- GzipFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), gz(nullptr) {}
+ explicit GzipFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), gz(nullptr) {}
virtual ~GzipFileFdPrivate() { InternalClose(""); }
#endif
};
virtual ~GzipFileFdPrivate() { InternalClose(""); }
#endif
};
- Bz2FileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), bz2(nullptr) {}
+ explicit Bz2FileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), bz2(nullptr) {}
virtual ~Bz2FileFdPrivate() { InternalClose(""); }
#endif
};
virtual ~Bz2FileFdPrivate() { InternalClose(""); }
#endif
};
- LzmaFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), lzma(nullptr) {}
+ explicit LzmaFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), lzma(nullptr) {}
virtual ~LzmaFileFdPrivate() { InternalClose(""); }
#endif
};
virtual ~LzmaFileFdPrivate() { InternalClose(""); }
#endif
};
compressor_pid = -1;
return Ret;
}
compressor_pid = -1;
return Ret;
}
- PipedFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {}
+ explicit PipedFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {}
virtual ~PipedFileFdPrivate() { InternalClose(""); }
};
/*}}}*/
virtual ~PipedFileFdPrivate() { InternalClose(""); }
};
/*}}}*/
virtual bool InternalClose(std::string const &) override { return true; }
virtual bool InternalAlwaysAutoClose() const override { return false; }
virtual bool InternalClose(std::string const &) override { return true; }
virtual bool InternalAlwaysAutoClose() const override { return false; }
- DirectFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {}
+ explicit DirectFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {}
virtual ~DirectFileFdPrivate() { InternalClose(""); }
};
/*}}}*/
virtual ~DirectFileFdPrivate() { InternalClose(""); }
};
/*}}}*/