We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b39e3a commit 68a8004Copy full SHA for 68a8004
include/simdjson/padded_string-inl.h
@@ -65,6 +65,11 @@ inline padded_string::padded_string(const std::string & str_ ) noexcept
65
// note: do pass std::string_view arguments by value
66
inline padded_string::padded_string(std::string_view sv_) noexcept
67
: viable_size(sv_.size()), data_ptr(internal::allocate_padded_buffer(sv_.size())) {
68
+ if(simdjson_unlikely(!data_ptr)) {
69
+ //allocation failed or zero size
70
+ viable_size=0;
71
+ return;
72
+ }
73
if (sv_.size()) {
74
std::memcpy(data_ptr, sv_.data(), sv_.size());
75
}
0 commit comments