aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-08-02 16:17:22 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-25 11:27:48 +0000
commit45683ee02c39f6e57f1f5e1065f4295292a0d8cf (patch)
tree139c2965e4956b393c1be3467b28ce7170b1a2b7 /contrib/epee/include
parentMerge pull request #4416 (diff)
downloadmonero-45683ee02c39f6e57f1f5e1065f4295292a0d8cf.tar.xz
epee: fix invalid memory write reading an array entry
Reported by Lilith Wyatt at Talos. Since this is not needed in normal operation, I just let this error out.
Diffstat (limited to 'contrib/epee/include')
-rw-r--r--contrib/epee/include/storages/portable_storage_from_bin.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/epee/include/storages/portable_storage_from_bin.h b/contrib/epee/include/storages/portable_storage_from_bin.h
index 44a80cb21..f9cc22d27 100644
--- a/contrib/epee/include/storages/portable_storage_from_bin.h
+++ b/contrib/epee/include/storages/portable_storage_from_bin.h
@@ -59,6 +59,7 @@ namespace epee
storage_entry load_storage_entry();
void read(section& sec);
void read(std::string& str);
+ void read(array_entry &ae);
private:
struct recursuion_limitation_guard
{
@@ -114,6 +115,7 @@ namespace epee
void throwable_buffer_reader::read(t_pod_type& pod_val)
{
RECURSION_LIMITATION();
+ static_assert(std::is_pod<t_pod_type>::value, "POD type expected");
read(&pod_val, sizeof(pod_val));
}
@@ -277,5 +279,11 @@ namespace epee
m_ptr+=len;
m_count -= len;
}
+ inline
+ void throwable_buffer_reader::read(array_entry &ae)
+ {
+ RECURSION_LIMITATION();
+ CHECK_AND_ASSERT_THROW_MES(false, "Reading array entry is not supported");
+ }
}
}