diff options
author | lloyd <[email protected]> | 2015-01-23 17:47:31 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-01-23 17:47:31 +0000 |
commit | 848314e16daed06e6e519dbf8c40edf9c85a51bf (patch) | |
tree | a7d246972486ae5f49090689090af7d351110ec6 /src/lib/compression | |
parent | b6cc9a4084caf6d9d4b955fadc321f6521f2b36e (diff) |
Centralize where string.h/cstring is included to mem_ops.h
See github 42 for background
Diffstat (limited to 'src/lib/compression')
-rw-r--r-- | src/lib/compression/comp_util.cpp | 4 | ||||
-rw-r--r-- | src/lib/compression/comp_util.h | 5 | ||||
-rw-r--r-- | src/lib/compression/zlib/zlib.cpp | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/compression/comp_util.cpp b/src/lib/compression/comp_util.cpp index 77b381c4e..05c9ddb3b 100644 --- a/src/lib/compression/comp_util.cpp +++ b/src/lib/compression/comp_util.cpp @@ -6,7 +6,7 @@ */ #include <botan/internal/comp_util.h> -#include <cstring> +#include <botan/mem_ops.h> #include <cstdlib> namespace Botan { @@ -29,7 +29,7 @@ void Compression_Alloc_Info::do_free(void* ptr) if(i == m_current_allocs.end()) throw std::runtime_error("Compression_Alloc_Info::free got pointer not allocated by us"); - std::memset(ptr, 0, i->second); + zero_mem(ptr, i->second); std::free(ptr); m_current_allocs.erase(i); } diff --git a/src/lib/compression/comp_util.h b/src/lib/compression/comp_util.h index 92989e518..6e1ee1671 100644 --- a/src/lib/compression/comp_util.h +++ b/src/lib/compression/comp_util.h @@ -9,7 +9,6 @@ #define BOTAN_COMPRESSION_UTILS_H__ #include <botan/compression.h> -#include <cstring> #include <memory> #include <unordered_map> @@ -64,13 +63,13 @@ class Zlib_Style_Stream : public Compression_Stream Zlib_Style_Stream() { - std::memset(&m_stream, 0, sizeof(stream_t)); + clear_mem(&m_stream, 1); m_allocs.reset(new Compression_Alloc_Info); } ~Zlib_Style_Stream() { - std::memset(&m_stream, 0, sizeof(stream_t)); + clear_mem(&m_stream, 1); m_allocs.reset(); } diff --git a/src/lib/compression/zlib/zlib.cpp b/src/lib/compression/zlib/zlib.cpp index 10581b739..8c94e4331 100644 --- a/src/lib/compression/zlib/zlib.cpp +++ b/src/lib/compression/zlib/zlib.cpp @@ -120,7 +120,7 @@ class Gzip_Compression_Stream : public Zlib_Compression_Stream Gzip_Compression_Stream(size_t level, int wbits, byte os_code) : Zlib_Compression_Stream(level, wbits, 16) { - std::memset(&m_header, 0, sizeof(m_header)); + clear_mem(&m_header, 1); m_header.os = os_code; m_header.time = std::time(nullptr); |