aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/config_file.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-06-19 18:28:37 (GMT)
committerJouni Malinen <j@w1.fi>2017-06-19 18:30:45 (GMT)
commit3c0daa13d5a4c43e4015e0fcd331f005dcdafe0b (patch)
treefda281c341855ca3befdf2c94ab9fe8be9ba8c6e /wpa_supplicant/config_file.c
parentd350084da81ccc6a50ac6c34cbe909f470de979a (diff)
downloadhostap-3c0daa13d5a4c43e4015e0fcd331f005dcdafe0b.zip
hostap-3c0daa13d5a4c43e4015e0fcd331f005dcdafe0b.tar.gz
hostap-3c0daa13d5a4c43e4015e0fcd331f005dcdafe0b.tar.bz2
Make wpa_config_read_blob() easier for static analyzers
While encoded == NULL could happen in the case of an empty blob, that will result in encoded_len == 0 and base64_decode() not derefencing the src argument. That seems to be too difficult for some static analyzers, so to avoid false warnings, explicitly reject the encoded == NULL case without even trying to base64 decode it. (CID 164709) Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/config_file.c')
-rw-r--r--wpa_supplicant/config_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 46a9e0b..dead8ad 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -312,7 +312,7 @@ static struct wpa_config_blob * wpa_config_read_blob(FILE *f, int *line,
encoded_len += len;
}
- if (!end) {
+ if (!end || !encoded) {
wpa_printf(MSG_ERROR, "Line %d: blob was not terminated "
"properly", *line);
os_free(encoded);