aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_fast_pac.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2008-10-29 17:33:24 (GMT)
committerJouni Malinen <j@w1.fi>2008-10-29 17:33:24 (GMT)
commit308a4ec81a450f8ce4366066e48612174c13786e (patch)
tree93877b6a0b44c381db15697b16608839ee46a762 /src/eap_peer/eap_fast_pac.c
parentdd20838a7d3248130616fbc1cb097281fbd75ab1 (diff)
downloadhostap-308a4ec81a450f8ce4366066e48612174c13786e.zip
hostap-308a4ec81a450f8ce4366066e48612174c13786e.tar.gz
hostap-308a4ec81a450f8ce4366066e48612174c13786e.tar.bz2
Verify fread(), fwrite(), and system() return values
These were starting to trigger compiler warning with recent glibc header files and gcc.
Diffstat (limited to 'src/eap_peer/eap_fast_pac.c')
-rw-r--r--src/eap_peer/eap_fast_pac.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/eap_peer/eap_fast_pac.c b/src/eap_peer/eap_fast_pac.c
index a052ee1..0f5ef81 100644
--- a/src/eap_peer/eap_fast_pac.c
+++ b/src/eap_peer/eap_fast_pac.c
@@ -533,6 +533,8 @@ static void eap_fast_write(char **buf, char **pos, size_t *buf_len,
static int eap_fast_write_pac(struct eap_sm *sm, const char *pac_file,
char *buf, size_t len)
{
+ int ret = 0;
+
if (os_strncmp(pac_file, "blob://", 7) == 0) {
struct wpa_config_blob *blob;
blob = os_zalloc(sizeof(*blob));
@@ -555,12 +557,16 @@ static int eap_fast_write_pac(struct eap_sm *sm, const char *pac_file,
"file '%s' for writing", pac_file);
return -1;
}
- fwrite(buf, 1, len, f);
+ if (fwrite(buf, 1, len, f) != len) {
+ wpa_printf(MSG_INFO, "EAP-FAST: Failed to write all "
+ "PACs into '%s'", pac_file);
+ ret = -1;
+ }
os_free(buf);
fclose(f);
}
- return 0;
+ return ret;
}