enforce proper URL limit (#6172)

This commit is contained in:
Christian Grothoff 2020-04-09 15:49:29 +02:00
parent 2844a9a7b3
commit dccb300b76
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -91,8 +91,9 @@ TALER_BANK_prepare_transfer (
size_t u_len = strlen (exchange_base_url) + 1; size_t u_len = strlen (exchange_base_url) + 1;
char *end; char *end;
if ( (d_len > (size_t) UINT32_MAX) || if ( (d_len >= (size_t) GNUNET_MAX_MALLOC_CHECKED) ||
(u_len > (size_t) UINT32_MAX) ) (u_len >= (size_t) GNUNET_MAX_MALLOC_CHECKED) ||
(d_len + u_len + sizeof (*wp) >= GNUNET_MAX_MALLOC_CHECKED) )
{ {
GNUNET_break (0); /* that's some long URL... */ GNUNET_break (0); /* that's some long URL... */
*buf = NULL; *buf = NULL;