]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
imv-swid: Cast json object strings when using it as chunk pointer
authorMartin Willi <martin@revosec.ch>
Tue, 3 Jun 2014 10:20:28 +0000 (12:20 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 3 Jun 2014 10:23:57 +0000 (12:23 +0200)
While the string is actually const, we don't have a const chunk to handle such
strings properly in chunks. Fixes compiler warnings.

src/libpts/plugins/imv_swid/imv_swid_agent.c
src/libpts/plugins/imv_swid/imv_swid_rest.c

index ffff6c6b88f47b36c0ec3845e5dfc7ac0a5a6a59..4278fadf7c9169a6dddf4a4bd4113bf9d04ae3c5 100644 (file)
@@ -562,7 +562,7 @@ METHOD(imv_agent_if_t, batch_ending, TNC_Result,
                                                json_object_put(jresponse);
                                                break;
                                        }
-                                       target = json_object_get_string(jvalue);
+                                       target = (char*)json_object_get_string(jvalue);
                                        DBG1(DBG_IMV, "  %s", target);
 
                                        /* Separate target into tag_creator and unique_sw_id */
index f40cc493151776881bc22f093b16311a6181f563..143b0b239aa075b7b5c0dedc3dbbf148b4b4803b 100644 (file)
@@ -58,7 +58,7 @@ METHOD(imv_swid_rest_t, post, status_t,
        {
                return FAILED;
        }
-       data = chunk_from_str(json_object_to_json_string(jrequest));
+       data = chunk_from_str((char*)json_object_to_json_string(jrequest));
 
        status = lib->fetcher->fetch(lib->fetcher, uri, &response,
                                FETCH_TIMEOUT, this->timeout,