]> git.ipfire.org Git - thirdparty/hostap.git/commit
Check os_snprintf() result more consistently - maximum length
authorJouni Malinen <j@w1.fi>
Sun, 7 Dec 2014 10:11:13 +0000 (12:11 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 8 Dec 2014 09:42:07 +0000 (11:42 +0200)
commita9aaacbb5081f41318ddb0fa597da6c29c6898df
treec62f64a16628dc076e21300ebb78fe71b784dca8
parent0047306bc9ab7d46e8cc22ff9a3e876c47626473
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>
src/drivers/driver_nl80211.c
wpa_supplicant/dbus/dbus_new_handlers.c
wpa_supplicant/dbus/dbus_old_handlers.c