diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-18 05:28:27 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-18 05:28:27 +0000 |
commit | cebdf93949c4dc203aca700705dc4032917db96c (patch) | |
tree | cf2c2e635728fe1d69cd9d8868542820f5f0de40 /src/or/router.c | |
parent | 7b5be147ee8ddbbddf866cb94600fde65f12f621 (diff) | |
download | tor-cebdf93949c4dc203aca700705dc4032917db96c.tar.gz tor-cebdf93949c4dc203aca700705dc4032917db96c.zip |
Fix bug 889: share deep-copied keys between threads to avoid races in reference counts. Bugfix on 0.1.0.1-rc.
svn:r17672
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/router.c b/src/or/router.c index 37172c17ba..8211d68197 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -75,8 +75,8 @@ get_onion_key(void) return onionkey; } -/** Store a copy of the current onion key into *<b>key</b>, and a copy - * of the most recent onion key into *<b>last</b>. +/** Store a full copy of the current onion key into *<b>key</b>, and a full + * copy of the most recent onion key into *<b>last</b>. */ void dup_onion_keys(crypto_pk_env_t **key, crypto_pk_env_t **last) @@ -85,9 +85,9 @@ dup_onion_keys(crypto_pk_env_t **key, crypto_pk_env_t **last) tor_assert(last); tor_mutex_acquire(key_lock); tor_assert(onionkey); - *key = crypto_pk_dup_key(onionkey); + *key = crypto_pk_copy_full(onionkey); if (lastonionkey) - *last = crypto_pk_dup_key(lastonionkey); + *last = crypto_pk_copy_full(lastonionkey); else *last = NULL; tor_mutex_release(key_lock); |