add assertion to be more defensive against buffer overflow (cannot happen, but this better protects against future changes)

This commit is contained in:
Christian Grothoff 2017-10-06 21:27:58 +02:00
parent 8f08e4634f
commit dc883f8556
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -235,6 +235,7 @@ parse_refresh_link_ok (struct TALER_EXCHANGE_RefreshLinkHandle *rlh,
/* decode all coins */ /* decode all coins */
for (i=0;i<json_array_size (jsona);i++) for (i=0;i<json_array_size (jsona);i++)
{ {
GNUNET_assert (i + off_coin < num_coins);
if (GNUNET_OK != if (GNUNET_OK !=
parse_refresh_link_coin (rlh, parse_refresh_link_coin (rlh,
json_array_get (jsona, json_array_get (jsona,