]> git.ipfire.org Git - thirdparty/hostap.git/commit - wpa_supplicant/config.c
Check os_snprintf() result more consistently - success case
authorJouni Malinen <j@w1.fi>
Sun, 7 Dec 2014 10:15:34 +0000 (12:15 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 8 Dec 2014 09:42:07 +0000 (11:42 +0200)
commita80ba67a26f51d61fc5875a22912c1316f1e1536
tree1c5a113da32fe89ce7b1764dcfd245d9da81e867
parenta9aaacbb5081f41318ddb0fa597da6c29c6898df
Check os_snprintf() result more consistently - success case

This converts os_snprintf() result validation cases to use
os_snprintf_error() in cases where success condition was used to execute
a step. 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 \) && \( (size_t) E1 < E3 \| E1 < (int) E3 \| E1 < E3 \))
+ if (!os_snprintf_error(E3, E1))
  S1

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/wps_hostapd.c
src/drivers/driver_nl80211_event.c
src/eap_server/eap_server_ttls.c
wpa_supplicant/config.c
wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_cli.c
wpa_supplicant/wps_supplicant.c