Commit 9744a48a authored by Celine Mercier's avatar Celine Mercier

BUG FIX: seemingly identical obiblobs would have different hash values

because of the padding added by the compiler. Fixed by using calloc
instead of malloc for obiblob memory allocation.
parent 6afdc9fb
......@@ -32,7 +32,7 @@ Obi_blob_p obi_blob(byte_t* encoded_value, uint8_t element_size, int32_t length_
Obi_blob_p blob;
// Allocate the memory for the blob structure
blob = (Obi_blob_p) malloc(sizeof(Obi_blob_t) + length_encoded_value);
blob = (Obi_blob_p) calloc(sizeof(Obi_blob_t) + length_encoded_value, sizeof(byte_t));
if (blob == NULL)
{
obi_set_errno(OBI_MALLOC_ERROR);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment