aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_old_handlers.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-07 10:11:13 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-08 09:42:07 (GMT)
commita9aaacbb5081f41318ddb0fa597da6c29c6898df (patch)
treec62f64a16628dc076e21300ebb78fe71b784dca8 /wpa_supplicant/dbus/dbus_old_handlers.c
parent0047306bc9ab7d46e8cc22ff9a3e876c47626473 (diff)
downloadhostap-a9aaacbb5081f41318ddb0fa597da6c29c6898df.zip
hostap-a9aaacbb5081f41318ddb0fa597da6c29c6898df.tar.gz
hostap-a9aaacbb5081f41318ddb0fa597da6c29c6898df.tar.bz2
Check os_snprintf() result more consistently - maximum length
This adds verification of os_snprintf() result against the maximum buffer length. These changes were done automatically with spatch using the following semantic patch: @@ expression E1,E2,E3; statement S1; @@ E1 = os_snprintf(E2, E3, ...); - if (\( E1 < 0 \| E1 <= 0 \)) + if (os_snprintf_error(E3, E1)) ( S1 | { ... } ) Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_old_handlers.c')
-rw-r--r--wpa_supplicant/dbus/dbus_old_handlers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wpa_supplicant/dbus/dbus_old_handlers.c b/wpa_supplicant/dbus/dbus_old_handlers.c
index 048158f..5f54cf1 100644
--- a/wpa_supplicant/dbus/dbus_old_handlers.c
+++ b/wpa_supplicant/dbus/dbus_old_handlers.c
@@ -981,7 +981,7 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
goto error;
ret = os_snprintf(value, size, "%u",
entry.uint32_value);
- if (ret <= 0)
+ if (os_snprintf_error(size, ret))
goto error;
} else if (entry.type == DBUS_TYPE_INT32) {
value = os_zalloc(size);
@@ -989,7 +989,7 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
goto error;
ret = os_snprintf(value, size, "%d",
entry.int32_value);
- if (ret <= 0)
+ if (os_snprintf_error(size, ret))
goto error;
} else
goto error;