]> git.meshlink.io Git - meshlink/commitdiff
Fixing segmentation faults because of missing initializations
authorSaverio Proto <zioproto@gmail.com>
Tue, 17 Jun 2014 16:11:12 +0000 (18:11 +0200)
committerSaverio Proto <zioproto@gmail.com>
Tue, 17 Jun 2014 16:11:12 +0000 (18:11 +0200)
src/meshlink.c
src/net_setup.c

index 31f2410c2d7cbb5e000e68e50cfe131d50412edc..2e6a37cc3ad1cdb4a8658abd1b06ec2f86eb331e 100644 (file)
@@ -739,6 +739,8 @@ meshlink_handle_t *meshlink_open(const char *confbase, const char *name) {
        if (usingname) mesh->name = xstrdup(name);
        mesh->self = new_node();
        mesh->self->connection = new_connection();
+       if(!read_ecdsa_private_key(mesh))
+               return false;
        pthread_mutex_init ( &(mesh->outpacketqueue_mutex), NULL);
        pthread_mutex_init ( &(mesh->nodes_mutex), NULL);
        mesh->threadstarted = false;
index 4ee4b95362a4a999a9e6b6715a78bb430a57d7fc..97ef4f1339fe77d896f9fba0d954b79bab977a14 100644 (file)
@@ -80,7 +80,7 @@ bool read_ecdsa_public_key(meshlink_handle_t *mesh, connection_t *c) {
        return false;
 }
 
-static bool read_ecdsa_private_key(meshlink_handle_t *mesh) {
+bool read_ecdsa_private_key(meshlink_handle_t *mesh) {
        FILE *fp;
        char filename[PATH_MAX];