fix NULL termination of fee list

This commit is contained in:
Christian Grothoff 2018-04-02 16:35:14 +02:00
parent 40a64e8f0c
commit 8ebb4cda07
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 14 additions and 1 deletions

View File

@ -167,8 +167,10 @@ parse_fees (json_t *fees)
free_fees (fm);
return NULL;
}
if (idx < len)
if (idx + 1 < len)
wa->next = &fe->fee_list[idx + 1];
else
wa->next = NULL;
}
}
return fm;

View File

@ -76,6 +76,16 @@ sign_account_data (void *cls,
JSON_INDENT(2));
json_decref (wire);
GNUNET_assert (NULL != json_out);
if (GNUNET_OK !=
GNUNET_DISK_directory_create_for_file (ai->wire_response_filename))
{
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"mkdir",
ai->wire_response_filename);
global_ret = 1;
free (json_out);
return;
}
out = fopen (ai->wire_response_filename,
"w+");
@ -85,6 +95,7 @@ sign_account_data (void *cls,
"fopen",
ai->wire_response_filename);
global_ret = 1;
free (json_out);
return;
}
fprintf (out,