diff options
author | Uros Majstorovic <majstor@majstor.org> | 2018-01-19 16:59:33 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2018-01-19 16:59:33 +0100 |
commit | cdf60abf74bfdfbeda27ee3c81f1d4cb50a987c1 (patch) | |
tree | 5f35d997ab2a9b1c8e4f7e6328d0aeb01fd06a55 | |
parent | 1425f72c38fe23a9d3fcda583a7da1e7315acfc3 (diff) |
fixed node init
-rw-r--r-- | code/ecp/core.c | 3 |
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; |