Fixed SIGSEGV when logging peer config matches.
authorTobias Brunner <tobias@strongswan.org>
Tue, 13 Dec 2011 12:08:54 +0000 (13:08 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 20 Mar 2012 16:31:20 +0000 (17:31 +0100)
src/libcharon/config/backend_manager.c

index 5fe137e..e7e7a90 100644 (file)
@@ -195,12 +195,13 @@ static id_match_t get_peer_match(identification_t *id,
        auth_cfg_t *auth;
        identification_t *candidate;
        id_match_t match = ID_MATCH_NONE;
+       char *where = local ? "local" : "remote";
        chunk_t data;
 
        if (!id)
        {
                DBG3(DBG_CFG, "peer config match %s: %d (%N)",
-                        local ? "local" : "remote", ID_MATCH_ANY, id_type_names, ID_ANY);
+                        where, ID_MATCH_ANY, id_type_names, ID_ANY);
                return ID_MATCH_ANY;
        }
 
@@ -227,7 +228,7 @@ static id_match_t get_peer_match(identification_t *id,
 
        data = id->get_encoding(id);
        DBG3(DBG_CFG, "peer config match %s: %d (%N -> %#B)",
-                match, id_type_names, id->get_type(id), &data);
+                where, match, id_type_names, id->get_type(id), &data);
        return match;
 }