commit ee472d754cf78e0e4b843899d5544d845d93cc37
parent 8dd6627543270f19e932ae247c84e18f6ed32922
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 29 Jun 2026 22:07:40 +0200
avoid stack allocation for possibly large response"
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/lib/exchange_api_get-reserves-RESERVE_PUB-history.c b/src/lib/exchange_api_get-reserves-RESERVE_PUB-history.c
@@ -851,7 +851,9 @@ parse_reserve_history (
{ "CLOSE", &parse_close },
{ NULL, NULL }
};
- struct GNUNET_HashCode uuid[history_length];
+ struct GNUNET_HashCode *uuid
+ = GNUNET_new_array (history_length,
+ struct GNUNET_HashCode);
struct HistoryParseContext uc = {
.keys = keys,
.reserve_pub = reserve_pub,
@@ -894,6 +896,7 @@ parse_reserve_history (
json_dumpf (transaction,
stderr,
JSON_INDENT (2));
+ GNUNET_free (uuid);
return GNUNET_SYSERR;
}
if (GNUNET_YES !=
@@ -901,6 +904,7 @@ parse_reserve_history (
total_in))
{
GNUNET_break_op (0);
+ GNUNET_free (uuid);
return GNUNET_SYSERR;
}
for (unsigned int i = 0; NULL != map[i].type; i++)
@@ -915,6 +919,7 @@ parse_reserve_history (
transaction))
{
GNUNET_break_op (0);
+ GNUNET_free (uuid);
return GNUNET_SYSERR;
}
break;
@@ -924,9 +929,11 @@ parse_reserve_history (
{
/* unexpected 'type', protocol incompatibility, complain! */
GNUNET_break_op (0);
+ GNUNET_free (uuid);
return GNUNET_SYSERR;
}
}
+ GNUNET_free (uuid);
return GNUNET_OK;
}