]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HS 2.0: Add NULL check before dereferencing in hs20-osu-client
authorRajiv Ranjan <c_rrajiv@qti.qualcomm.com>
Thu, 5 Mar 2015 11:56:39 +0000 (17:26 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 6 Mar 2015 11:37:16 +0000 (13:37 +0200)
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>
hs20/client/oma_dm_client.c

index 6eaeeb4778433918dfd859620308ea049ae367c9..5854b726dba2b3c935b43b7d9ed37451430dcc93 100644 (file)
@@ -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");
        }