From dccb300b76fbf35ced3bb6b8becbfc2ba98407cc Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 9 Apr 2020 15:49:29 +0200 Subject: [PATCH] enforce proper URL limit (#6172) --- src/bank-lib/bank_api_transfer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bank-lib/bank_api_transfer.c b/src/bank-lib/bank_api_transfer.c index 0cf59602e..5ec747605 100644 --- a/src/bank-lib/bank_api_transfer.c +++ b/src/bank-lib/bank_api_transfer.c @@ -91,8 +91,9 @@ TALER_BANK_prepare_transfer ( size_t u_len = strlen (exchange_base_url) + 1; char *end; - if ( (d_len > (size_t) UINT32_MAX) || - (u_len > (size_t) UINT32_MAX) ) + if ( (d_len >= (size_t) GNUNET_MAX_MALLOC_CHECKED) || + (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... */ *buf = NULL;