aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorRajiv Ranjan <c_rrajiv@qti.qualcomm.com>2015-03-05 11:56:39 (GMT)
committerJouni Malinen <j@w1.fi>2015-03-06 11:37:16 (GMT)
commit088a210d6088a3d1aac6f0056db4f00a93ff508f (patch)
treec01cb9ea34c2113934158a3f63ea372db48470b1 /hs20
parentbea8d9a39a848c8f6c6ffc6084a7e99b489a389e (diff)
downloadhostap-088a210d6088a3d1aac6f0056db4f00a93ff508f.zip
hostap-088a210d6088a3d1aac6f0056db4f00a93ff508f.tar.gz
hostap-088a210d6088a3d1aac6f0056db4f00a93ff508f.tar.bz2
HS 2.0: Add NULL check before dereferencing in hs20-osu-client
xml_node_get_text() may return NULL, so need to check the return value before using it. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hs20')
-rw-r--r--hs20/client/oma_dm_client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hs20/client/oma_dm_client.c b/hs20/client/oma_dm_client.c
index 6eaeeb4..5854b72 100644
--- a/hs20/client/oma_dm_client.c
+++ b/hs20/client/oma_dm_client.c
@@ -772,6 +772,11 @@ static int oma_dm_replace(struct hs20_osu_client *ctx, xml_node_t *replace,
if (node) {
char *type;
type = xml_node_get_text(ctx->xml, node);
+ if (type == NULL) {
+ wpa_printf(MSG_INFO, "Could not find type text");
+ os_free(locuri);
+ return DM_RESP_BAD_REQUEST;
+ }
use_tnds = node &&
os_strstr(type, "application/vnd.syncml.dmtnds+xml");
}