Initialize variables that some compilers seem to warn about
authorTobias Brunner <tobias@strongswan.org>
Thu, 13 Aug 2015 13:09:00 +0000 (15:09 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 13 Aug 2015 13:12:38 +0000 (15:12 +0200)
src/libcharon/plugins/vici/vici_control.c
src/libcharon/sa/ikev2/authenticators/pubkey_authenticator.c
src/libstrongswan/plugins/plugin_feature.c
src/libstrongswan/utils/utils/string.c

index 01d5036..408d299 100644 (file)
@@ -138,7 +138,7 @@ static child_cfg_t* find_child_cfg(char *name, peer_cfg_t **out)
 {
        enumerator_t *enumerator;
        peer_cfg_t *peer_cfg;
-       child_cfg_t *child_cfg;
+       child_cfg_t *child_cfg = NULL;
 
        enumerator = charon->backends->create_peer_cfg_enumerator(
                                                        charon->backends, NULL, NULL, NULL, NULL, IKE_ANY);
index 151b497..2284a48 100644 (file)
@@ -321,7 +321,7 @@ METHOD(authenticator_t, build, status_t,
        chunk_t auth_data;
        status_t status;
        auth_payload_t *auth_payload;
-       auth_method_t auth_method;
+       auth_method_t auth_method = AUTH_NONE;
 
        id = this->ike_sa->get_my_id(this->ike_sa);
        auth = this->ike_sa->get_auth_cfg(this->ike_sa, TRUE);
index 2d0ce8a..e909f4a 100644 (file)
@@ -59,7 +59,7 @@ ENUM(plugin_feature_names, FEATURE_NONE, FEATURE_CUSTOM,
  */
 u_int32_t plugin_feature_hash(plugin_feature_t *feature)
 {
-       chunk_t data;
+       chunk_t data = chunk_empty;
 
        switch (feature->type)
        {
index 14087e7..56910ed 100644 (file)
@@ -44,7 +44,7 @@ char* translate(char *str, const char *from, const char *to)
 char* strreplace(const char *str, const char *search, const char *replace)
 {
        size_t len, slen, rlen, count = 0;
-       char *res, *pos, *found, *dst;
+       char *res, *pos, *found = NULL, *dst;
 
        if (!str || !*str || !search || !*search || !replace)
        {