more stringent overflow checks

This commit is contained in:
Christian Grothoff 2020-03-27 13:32:16 +01:00
parent 1c1d4e1ad6
commit e8c8efe5ec
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -284,7 +284,10 @@ TALER_BANK_transfer (
}
d_len = ntohl (wp->account_len);
u_len = ntohl (wp->exchange_url_len);
if (sizeof (*wp) + d_len + u_len != buf_size)
if ( (sizeof (*wp) + d_len + u_len != buf_size) ||
(d_len > buf_size) ||
(u_len > buf_size) ||
(d_len + u_len > buf_size) )
{
GNUNET_break (0);
return NULL;