Skip to content

Commit

Permalink
Fix another crasher:
Browse files Browse the repository at this point in the history
- If the key/value list has to be reallocated, malloc it with the proper size.
  • Loading branch information
zcutlip committed Jan 31, 2015
1 parent 7a8d09b commit 266c8f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nvram-faker.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int ini_handler(void *user, const char *section, const char *name,const c
{
old_kv_len=key_value_pair_len;
key_value_pair_len=(key_value_pair_len * 2);
new_kv=(char **)malloc(key_value_pair_len);
new_kv=(char **)malloc(key_value_pair_len * sizeof(char **));
if(NULL == kv)
{
LOG_PRINTF("Failed to reallocate key value array.\n");
Expand Down

0 comments on commit 266c8f9

Please sign in to comment.