]> git.meshlink.io Git - meshlink/commitdiff
meshlink_join: fix Segmentation Fault when invitation URL is missing the port number
authorSaverio Proto <zioproto@gmail.com>
Tue, 3 Jun 2014 14:41:08 +0000 (16:41 +0200)
committerSaverio Proto <zioproto@gmail.com>
Tue, 3 Jun 2014 14:41:08 +0000 (16:41 +0200)
src/meshlink.c

index fc8408ad1309843d9641df75a47323f0411b192d..511a6d15546850ffe8b45d82b3c460bb75694cc2 100644 (file)
@@ -1158,7 +1158,7 @@ bool meshlink_join(meshlink_handle_t *mesh, const char *invitation) {
                        *port++ = 0;
        }
 
-       if(!*port)
+       if(!port)
                port = "655";
 
        if(!b64decode(slash, mesh->hash, 18) || !b64decode(slash + 24, mesh->cookie, 18))