aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2020-03-22 15:24:21 (GMT)
committerJouni Malinen <j@w1.fi>2020-03-22 16:50:04 (GMT)
commita2c23195ade1fd6fad66b0fbad433133c492a2c9 (patch)
treec6a59a13670700f5324f826c0231b9f614e46dac
parentd2d16e3100ed15fffa3c475568689b3f1449e976 (diff)
downloadhostap-a2c23195ade1fd6fad66b0fbad433133c492a2c9.zip
hostap-a2c23195ade1fd6fad66b0fbad433133c492a2c9.tar.gz
hostap-a2c23195ade1fd6fad66b0fbad433133c492a2c9.tar.bz2
D-Bus: Use size_t for values theoretically larger than 16-bit int
These are theoretical cases with 32-bit integers, but cases that could potentially hit an integer overflow with 16-bit int. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index c842c50..01fc67b 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1146,7 +1146,7 @@ static int wpas_dbus_get_scan_ies(DBusMessage *message, DBusMessageIter *var,
DBusMessage **reply)
{
u8 *ies = NULL, *nies;
- int ies_len = 0;
+ size_t ies_len = 0;
DBusMessageIter array_iter, sub_array_iter;
char *val;
int len;
@@ -1177,7 +1177,7 @@ static int wpas_dbus_get_scan_ies(DBusMessage *message, DBusMessageIter *var,
dbus_message_iter_recurse(&array_iter, &sub_array_iter);
dbus_message_iter_get_fixed_array(&sub_array_iter, &val, &len);
- if (len == 0) {
+ if (len <= 0) {
dbus_message_iter_next(&array_iter);
continue;
}
@@ -1208,7 +1208,7 @@ static int wpas_dbus_get_scan_channels(DBusMessage *message,
{
DBusMessageIter array_iter, sub_array_iter;
int *freqs = NULL, *nfreqs;
- int freqs_num = 0;
+ size_t freqs_num = 0;
if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_ARRAY) {
wpa_printf(MSG_DEBUG,