You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use of memcpy() in the value constructors is undefined behavior. You are assuming that these objects don't have internal references (or in the case of std::shared_ptr external references). C++ objects can not simply be copied by using memcpy they should be copied using the copy of move constructor.
Issues are:
inline value::value(value &&rhs) noexcept
inline value &value::operator=(string const &s)
inline value &value::operator=(string &&s)
inline value &value::operator=(array const &a)
inline value &value::operator=(array &&a)
inline value &value::operator=(object const &o)
inline value &value::operator=(object &&o)
inline value &value::operator=(value &&rhs) noexcept
inline void value::swap(value &other) noexcept
The following json files when read into value object will cause a crash (caused by bad call to free()).
ujson/ujson/ujson.hpp
Lines 514 to 517 in 2b17263
The use of
memcpy()
in thevalue
constructors is undefined behavior. You are assuming that these objects don't have internal references (or in the case ofstd::shared_ptr
external references). C++ objects can not simply be copied by using memcpy they should be copied using the copy of move constructor.Issues are:
The following json files when read into
value
object will cause a crash (caused by bad call to free()).Note: This builds and works fine on my apple (OS-X 10.15.5)
But fails on Linux (Ubuntu 18.04)
The text was updated successfully, but these errors were encountered: