[tor-commits] [tor/master] Allow null ID argument to extend_info_new.

dgoulet at torproject.org dgoulet at torproject.org
Thu Jul 2 18:20:01 UTC 2020


commit 6a0b9e47462d7c0bcb4598343cc7d6e7689216d7
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Jul 1 14:20:17 2020 -0400

    Allow null ID argument to extend_info_new.
---
 src/core/or/extendinfo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/or/extendinfo.c b/src/core/or/extendinfo.c
index 874a0a58f..8f506d774 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)





More information about the tor-commits mailing list