aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-02-23 16:43:38 (GMT)
committerJouni Malinen <j@w1.fi>2019-02-25 17:48:49 (GMT)
commit429ed54a3daee0e8758109b8ed86ca9ca735789c (patch)
treea2af485e2b87585493df442e4f8ce87a7e7eacda /src/radius
parentb3957edbe9c646129481b606ccf653101ba7bc15 (diff)
downloadhostap-429ed54a3daee0e8758109b8ed86ca9ca735789c.zip
hostap-429ed54a3daee0e8758109b8ed86ca9ca735789c.tar.gz
hostap-429ed54a3daee0e8758109b8ed86ca9ca735789c.tar.bz2
UBSan: Avoid a warning on signed left shift
Use unsigned 1 (1U) instead of signed (1) when doing left shift that could potentially need to use all bits of the 32-bit unsigned variable. radius_server.c:2254:14: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/radius/radius_server.c b/src/radius/radius_server.c
index aa78cba..1c15c2c 100644
--- a/src/radius/radius_server.c
+++ b/src/radius/radius_server.c
@@ -1,6 +1,6 @@
/*
* RADIUS authentication server
- * Copyright (c) 2005-2009, 2011-2014, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2005-2009, 2011-2019, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
@@ -2251,7 +2251,7 @@ radius_server_read_clients(const char *client_file, int ipv6)
entry->addr.s_addr = addr.s_addr;
val = 0;
for (i = 0; i < mask; i++)
- val |= 1 << (31 - i);
+ val |= 1U << (31 - i);
entry->mask.s_addr = htonl(val);
}
#ifdef CONFIG_IPV6