mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 03:59:33 +00:00
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.
This commit is contained in:
parent
f61cd54465
commit
58ee1f2bde
1 changed files with 8 additions and 0 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue