mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-06-26 14:34:02 +02:00
parent
fc3de9806e
commit
3feac1f51d
@ -171,7 +171,7 @@ inline void unpack_str(unpack_user& u, const char* p, uint32_t l, msgpack::objec
|
|||||||
o.via.str.ptr = p;
|
o.via.str.ptr = p;
|
||||||
u.set_referenced(true);
|
u.set_referenced(true);
|
||||||
}
|
}
|
||||||
else {
|
else if (l > 0) {
|
||||||
if (l > u.limit().str()) throw msgpack::str_size_overflow("str size overflow");
|
if (l > u.limit().str()) throw msgpack::str_size_overflow("str size overflow");
|
||||||
char* tmp = static_cast<char*>(u.zone().allocate_align(l, MSGPACK_ZONE_ALIGNOF(char)));
|
char* tmp = static_cast<char*>(u.zone().allocate_align(l, MSGPACK_ZONE_ALIGNOF(char)));
|
||||||
std::memcpy(tmp, p, l);
|
std::memcpy(tmp, p, l);
|
||||||
@ -187,7 +187,7 @@ inline void unpack_bin(unpack_user& u, const char* p, uint32_t l, msgpack::objec
|
|||||||
o.via.bin.ptr = p;
|
o.via.bin.ptr = p;
|
||||||
u.set_referenced(true);
|
u.set_referenced(true);
|
||||||
}
|
}
|
||||||
else {
|
else if (l > 0) {
|
||||||
if (l > u.limit().bin()) throw msgpack::bin_size_overflow("bin size overflow");
|
if (l > u.limit().bin()) throw msgpack::bin_size_overflow("bin size overflow");
|
||||||
char* tmp = static_cast<char*>(u.zone().allocate_align(l, MSGPACK_ZONE_ALIGNOF(char)));
|
char* tmp = static_cast<char*>(u.zone().allocate_align(l, MSGPACK_ZONE_ALIGNOF(char)));
|
||||||
std::memcpy(tmp, p, l);
|
std::memcpy(tmp, p, l);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user