aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-06-23 18:12:29 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-23 18:16:15 (GMT)
commitc1a14ef42f1decf308133a133aa1cd429093fdec (patch)
tree3d29b7f3a6619f576b4e20365e8cb7e133ffd518 /wpa_supplicant/dbus
parentfdc5608c125c21975728df1f526ebe1fd232f48e (diff)
downloadhostap-c1a14ef42f1decf308133a133aa1cd429093fdec.zip
hostap-c1a14ef42f1decf308133a133aa1cd429093fdec.tar.gz
hostap-c1a14ef42f1decf308133a133aa1cd429093fdec.tar.bz2
Do not check unsigned size is less than zero
The variables here are unsigned and as such, cannot have a negative value. Use == 0 instead of <= 0 to make this cleaner. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/dbus')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c2
-rw-r--r--wpa_supplicant/dbus/dbus_old_handlers.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 2a7e2cf..1c04e92 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -214,7 +214,7 @@ dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s,
} else if (entry.type == DBUS_TYPE_STRING) {
if (should_quote_opt(entry.key)) {
size = os_strlen(entry.str_value);
- if (size <= 0)
+ if (size == 0)
goto error;
size += 3;
diff --git a/wpa_supplicant/dbus/dbus_old_handlers.c b/wpa_supplicant/dbus/dbus_old_handlers.c
index 0ffa1be..20442d6 100644
--- a/wpa_supplicant/dbus/dbus_old_handlers.c
+++ b/wpa_supplicant/dbus/dbus_old_handlers.c
@@ -884,7 +884,7 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
if (should_quote_opt(entry.key)) {
size = os_strlen(entry.str_value);
/* Zero-length option check */
- if (size <= 0)
+ if (size == 0)
goto error;
size += 3; /* For quotes and terminator */
value = os_zalloc(size);