summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-01-19 16:59:33 +0100
committerUros Majstorovic <majstor@majstor.org>2018-01-19 16:59:33 +0100
commitcdf60abf74bfdfbeda27ee3c81f1d4cb50a987c1 (patch)
tree5f35d997ab2a9b1c8e4f7e6328d0aeb01fd06a55 /code
parent1425f72c38fe23a9d3fcda583a7da1e7315acfc3 (diff)
fixed node init
Diffstat (limited to 'code')
-rw-r--r--code/ecp/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/code/ecp/core.c b/code/ecp/core.c
index 2631f13..f8d3ec7 100644
--- a/code/ecp/core.c
+++ b/code/ecp/core.c
@@ -16,7 +16,8 @@ int ecp_node_init(ECPContext *ctx, ECPNode *node, ecp_dh_public_t *public, void
int rv = ECP_OK;
memset(node, 0, sizeof(ECPNode));
- memcpy(&node->public, public, sizeof(node->public));
+
+ if (public) memcpy(&node->public, public, sizeof(node->public));
if (addr && ctx->tr.addr_set) rv = ctx->tr.addr_set(&node->addr, addr);
if (rv) return ECP_ERR_NET_ADDR;