summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
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;