src: rework mem_clear()
This commit is contained in:
@@ -83,7 +83,7 @@ int upx_compress(const upx_bytep src, unsigned src_len, upx_bytep dst, unsigned
|
||||
|
||||
if (!cresult)
|
||||
cresult = &cresult_buffer;
|
||||
memset(cresult, 0, sizeof(*cresult));
|
||||
cresult->reset();
|
||||
#if 1
|
||||
// debugging aid
|
||||
cresult->debug.method = method;
|
||||
|
||||
@@ -433,7 +433,7 @@ int upx_lzma_decompress(const upx_bytep src, unsigned src_len, upx_bytep dst, un
|
||||
COMPILE_TIME_ASSERT(LZMA_LIT_SIZE == 768)
|
||||
|
||||
CLzmaDecoderState s;
|
||||
memset(&s, 0, sizeof(s));
|
||||
mem_clear(&s);
|
||||
SizeT src_out = 0, dst_out = 0;
|
||||
int r = UPX_E_ERROR;
|
||||
int rh;
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
#include <zlib/deflate.h>
|
||||
|
||||
void zlib_compress_config_t::reset() noexcept {
|
||||
mem_clear(this, sizeof(*this));
|
||||
|
||||
mem_clear(this);
|
||||
mem_level.reset();
|
||||
window_bits.reset();
|
||||
strategy.reset();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../conf.h"
|
||||
|
||||
void zstd_compress_config_t::reset() noexcept { mem_clear(this, sizeof(*this)); }
|
||||
void zstd_compress_config_t::reset() noexcept { mem_clear(this); }
|
||||
|
||||
#if WITH_ZSTD
|
||||
#include "compress.h"
|
||||
|
||||
Reference in New Issue
Block a user