Skip to content

Commit

Permalink
fix mem error in to_base64_json
Browse files Browse the repository at this point in the history
alloc space for newline in encode buffer
  • Loading branch information
cyrush committed Sep 28, 2016
1 parent 4814724 commit 4f9e753
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/conduit/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10608,7 +10608,7 @@ Node::to_base64_json(std::ostream &os,
// use libb64 to encode the data
index_t nbytes = n.schema().total_bytes();
Node bb64_data;
bb64_data.set(DataType::char8_str(nbytes*2));
bb64_data.set(DataType::char8_str(nbytes*2+1));

const char *src_ptr = (const char*)n.data_ptr();
char *dest_ptr = (char*)bb64_data.data_ptr();
Expand Down

0 comments on commit 4f9e753

Please sign in to comment.