aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-25 11:39:38 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-25 11:39:38 -0400
commitb91dce9454c3db669a07968b25a4fa03d8526917 (patch)
treed1e4aa46835978b63628a1dbd3e5782140cb72fa /src/or/rendclient.c
parent0de3147bf1b7a76b99ced69bde6e2169bb9a0caa (diff)
parent6069c829f90576c04a0802d2a108378a2bbabb7a (diff)
downloadtor-b91dce9454c3db669a07968b25a4fa03d8526917.tar.gz
tor-b91dce9454c3db669a07968b25a4fa03d8526917.zip
Merge branch 'maint-0.3.1'
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 0f430d1f88..55f79c50fb 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -227,6 +227,11 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
klen = crypto_pk_asn1_encode(extend_info->onion_key,
tmp+v3_shift+7+DIGEST_LEN+2,
sizeof(tmp)-(v3_shift+7+DIGEST_LEN+2));
+ if (klen < 0) {
+ log_warn(LD_BUG,"Internal error: can't encode public key.");
+ status = -2;
+ goto perm_err;
+ }
set_uint16(tmp+v3_shift+7+DIGEST_LEN, htons(klen));
memcpy(tmp+v3_shift+7+DIGEST_LEN+2+klen, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);