RADIUS: Use size_t instead of int for message attributes

While RADIUS messages are limited to 4 kB, use size_t to avoid even a
theoretical overflow issue with 16-bit int.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-03-22 18:00:28 +02:00
parent a2c23195ad
commit 02b43c557c

View file

@ -609,7 +609,7 @@ static int radius_msg_add_attr_to_array(struct radius_msg *msg,
{ {
if (msg->attr_used >= msg->attr_size) { if (msg->attr_used >= msg->attr_size) {
size_t *nattr_pos; size_t *nattr_pos;
int nlen = msg->attr_size * 2; size_t nlen = msg->attr_size * 2;
nattr_pos = os_realloc_array(msg->attr_pos, nlen, nattr_pos = os_realloc_array(msg->attr_pos, nlen,
sizeof(*msg->attr_pos)); sizeof(*msg->attr_pos));