mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
Check for no key_mgmt/proto/auth_alg entries in config writer
This is not really necessary check, but it keeps a static analyzer happier by avoiding dead increment. Doing it this way rather than removing the increment is less likely to cause problems when new entries are added here in the future (the "dead" increment would be very much needed in those cases). Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
290ea6a76e
commit
a1e46f320d
@ -467,6 +467,11 @@ static char * wpa_config_write_proto(const struct parse_data *data,
|
|||||||
pos += ret;
|
pos += ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pos == buf) {
|
||||||
|
os_free(buf);
|
||||||
|
buf = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif /* NO_CONFIG_WRITE */
|
#endif /* NO_CONFIG_WRITE */
|
||||||
@ -672,6 +677,11 @@ static char * wpa_config_write_key_mgmt(const struct parse_data *data,
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_WPS */
|
#endif /* CONFIG_WPS */
|
||||||
|
|
||||||
|
if (pos == buf) {
|
||||||
|
os_free(buf);
|
||||||
|
buf = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif /* NO_CONFIG_WRITE */
|
#endif /* NO_CONFIG_WRITE */
|
||||||
@ -863,6 +873,11 @@ static char * wpa_config_write_auth_alg(const struct parse_data *data,
|
|||||||
pos += ret;
|
pos += ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pos == buf) {
|
||||||
|
os_free(buf);
|
||||||
|
buf = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif /* NO_CONFIG_WRITE */
|
#endif /* NO_CONFIG_WRITE */
|
||||||
|
Loading…
Reference in New Issue
Block a user