forked from such-gitea/wownero-lws
ZMQ Hardening (#96)
This commit is contained in:
committed by
Lee *!* Clagett
parent
ffdd8da2a9
commit
f66943dce1
@@ -10,6 +10,8 @@
|
||||
#include "wire/json/read.h"
|
||||
#include "wire/json/write.h"
|
||||
#include "wire/vector.h"
|
||||
#include "wire/wrapper/array.h"
|
||||
#include "wire/wrappers_impl.h"
|
||||
|
||||
#include "wire/base.test.h"
|
||||
|
||||
@@ -31,7 +33,8 @@ namespace
|
||||
template<typename F, typename T>
|
||||
void basic_object_map(F& format, T& self)
|
||||
{
|
||||
wire::object(format, WIRE_FIELD(utf8), WIRE_FIELD(vec), WIRE_FIELD(data), WIRE_FIELD(choice));
|
||||
using max_vec = wire::max_element_count<100>;
|
||||
wire::object(format, WIRE_FIELD(utf8), WIRE_FIELD_ARRAY(vec, max_vec), WIRE_FIELD(data), WIRE_FIELD(choice));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -30,9 +30,12 @@
|
||||
#include <boost/range/algorithm/equal.hpp>
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
#include "wire/field.h"
|
||||
#include "wire/traits.h"
|
||||
#include "wire/msgpack.h"
|
||||
#include "wire/vector.h"
|
||||
#include "wire/wrapper/array.h"
|
||||
#include "wire/wrappers_impl.h"
|
||||
|
||||
#include "wire/base.test.h"
|
||||
|
||||
@@ -65,9 +68,10 @@ namespace
|
||||
template<typename F, typename T>
|
||||
void basic_object_map(F& format, T& self)
|
||||
{
|
||||
using vec_max = wire::max_element_count<100>;
|
||||
wire::object(format,
|
||||
WIRE_FIELD_ID(0, utf8),
|
||||
WIRE_FIELD_ID(1, vec),
|
||||
wire::field<1>("vec", wire::array<vec_max>(std::ref(self.vec))),
|
||||
WIRE_FIELD_ID(2, data),
|
||||
WIRE_FIELD_ID(254, choice)
|
||||
);
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include "wire/json.h"
|
||||
#include "wire/msgpack.h"
|
||||
#include "wire/vector.h"
|
||||
#include "wire/wrapper/array.h"
|
||||
#include "wire/wrappers_impl.h"
|
||||
|
||||
#include "wire/base.test.h"
|
||||
|
||||
@@ -70,12 +72,13 @@ namespace
|
||||
template<typename F, typename T>
|
||||
void complex_map(F& format, T& self)
|
||||
{
|
||||
using max_vec = wire::max_element_count<100>;
|
||||
wire::object(format,
|
||||
WIRE_FIELD(objects),
|
||||
WIRE_FIELD(ints),
|
||||
WIRE_FIELD(uints),
|
||||
WIRE_FIELD_ARRAY(objects, max_vec),
|
||||
WIRE_FIELD_ARRAY(ints, max_vec),
|
||||
WIRE_FIELD_ARRAY(uints, max_vec),
|
||||
WIRE_FIELD(blobs),
|
||||
WIRE_FIELD(strings),
|
||||
WIRE_FIELD_ARRAY(strings, max_vec),
|
||||
WIRE_FIELD(choice)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user