diff options
author | Guido Vranken <guidovranken@gmail.com> | 2019-03-17 17:39:37 +0100 |
---|---|---|
committer | Guido Vranken <guidovranken@gmail.com> | 2019-03-18 00:49:12 +0100 |
commit | 43042a28ec47044b39024152e6bb706616e0d7fa (patch) | |
tree | ba6e8f45a4dfba10f208df873d1b7651848f276c /contrib/epee/include | |
parent | Merge pull request #5191 (diff) | |
download | monero-43042a28ec47044b39024152e6bb706616e0d7fa.tar.xz |
Implement array_entry_t copy constructor
Manually initialize the array_entry_t iterator to ensure it points
to the correct m_array, thereby preventing a potential use-after-free
situation.
Signed-off-by: Guido Vranken <guidovranken@gmail.com>
Diffstat (limited to 'contrib/epee/include')
-rw-r--r-- | contrib/epee/include/storages/portable_storage_base.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/epee/include/storages/portable_storage_base.h b/contrib/epee/include/storages/portable_storage_base.h index da84fd8ea..ca7c81ddc 100644 --- a/contrib/epee/include/storages/portable_storage_base.h +++ b/contrib/epee/include/storages/portable_storage_base.h @@ -82,6 +82,7 @@ namespace epee struct array_entry_t { array_entry_t():m_it(m_array.end()){} + array_entry_t(const array_entry_t& other):m_array(other.m_array), m_it(m_array.end()){} const t_entry_type* get_first_val() const { |