From: Rajiv Ranjan Date: Thu, 5 Mar 2015 11:56:39 +0000 (+0530) Subject: HS 2.0: Add NULL check before dereferencing in hs20-osu-client X-Git-Tag: hostap_2_4~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=088a210d6088a3d1aac6f0056db4f00a93ff508f;p=thirdparty%2Fhostap.git 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 --- diff --git a/hs20/client/oma_dm_client.c b/hs20/client/oma_dm_client.c index 6eaeeb477..5854b726d 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"); }