Skip to content

Commit

Permalink
bug fix: Blob copy constructor was not taking into account the memory…
Browse files Browse the repository at this point in the history
… mode of the object being copied (it would cause a seg fault if the mode was BLOB_GENERATOR)
  • Loading branch information
tgarr authored Dec 12, 2024
1 parent b9b47c9 commit 419c558
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Blob::Blob(const Blob& other) :
bytes(nullptr), size(0), capacity(0), memory_mode(object_memory_mode_t::DEFAULT) {
if(other.size > 0) {
uint8_t* t_bytes = static_cast<uint8_t*>(malloc(other.size));
if (memory_mode == object_memory_mode_t::BLOB_GENERATOR) {
if (other.memory_mode == object_memory_mode_t::BLOB_GENERATOR) {
// instantiate data.
auto number_bytes_generated = other.blob_generator(t_bytes,other.size);
if (number_bytes_generated != other.size) {
Expand Down

0 comments on commit 419c558

Please sign in to comment.