malloc(0) fixed
This commit is contained in:
parent
a178c76116
commit
3e678b64be
@ -17,7 +17,10 @@ void hash_data(pub_data *data, unsigned char *buf) {
|
|||||||
|
|
||||||
// Hash every data contained in data_list then return a network hash
|
// Hash every data contained in data_list then return a network hash
|
||||||
void hash_network(list *data_list, unsigned char *buf) {
|
void hash_network(list *data_list, unsigned char *buf) {
|
||||||
unsigned char *concat = (unsigned char*) malloc(0);
|
// Get list length to initialize concat buffer
|
||||||
|
int concat_len = len_list(data_list) * SHA256_DIGEST_LENGTH;
|
||||||
|
unsigned char *concat = (unsigned char*) malloc(concat_len);
|
||||||
|
|
||||||
unsigned char hash[SHA256_DIGEST_LENGTH];
|
unsigned char hash[SHA256_DIGEST_LENGTH];
|
||||||
int totlen = 0;
|
int totlen = 0;
|
||||||
list *tmp = data_list;
|
list *tmp = data_list;
|
||||||
|
Loading…
Reference in New Issue
Block a user