diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-07-01 14:20:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-02 09:51:04 -0400 |
commit | 6a0b9e47462d7c0bcb4598343cc7d6e7689216d7 (patch) | |
tree | c3d87963b9093dffa72d9c1f5370fe48d4791c4c /src | |
parent | ad71303f5f07972ca7576a500e4ac6f6bffbd853 (diff) | |
download | tor-6a0b9e47462d7c0bcb4598343cc7d6e7689216d7.tar.gz tor-6a0b9e47462d7c0bcb4598343cc7d6e7689216d7.zip |
Allow null ID argument to extend_info_new.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/or/extendinfo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/or/extendinfo.c b/src/core/or/extendinfo.c index 874a0a58f8..8f506d774c 100644 --- a/src/core/or/extendinfo.c +++ b/src/core/or/extendinfo.c @@ -35,7 +35,8 @@ extend_info_new(const char *nickname, const tor_addr_t *addr, uint16_t port) { extend_info_t *info = tor_malloc_zero(sizeof(extend_info_t)); - memcpy(info->identity_digest, rsa_id_digest, DIGEST_LEN); + if (rsa_id_digest) + memcpy(info->identity_digest, rsa_id_digest, DIGEST_LEN); if (ed_id && !ed25519_public_key_is_zero(ed_id)) memcpy(&info->ed_identity, ed_id, sizeof(ed25519_public_key_t)); if (nickname) |