diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-07 08:44:40 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-07 08:44:40 -0400 |
commit | a4930de5e96b83295478386cd15c8a7a3e8c0ef8 (patch) | |
tree | 40bdd22c32ed6ba2adc7ef5acafce866cf1fc4d7 /src/or | |
parent | b6de39e5f465259b78d3886e0231d3dfef58fc1f (diff) | |
parent | df18cf0e8fa9195df82bef9535f920ad913efab7 (diff) | |
download | tor-a4930de5e96b83295478386cd15c8a7a3e8c0ef8.tar.gz tor-a4930de5e96b83295478386cd15c8a7a3e8c0ef8.zip |
Merge branch 'maint-0.3.3' into maint-0.3.4
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/rendclient.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 7ef12a4faf..74118f8f37 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -240,6 +240,15 @@ rend_client_send_introduction(origin_circuit_t *introcirc, dh_offset = v3_shift+7+DIGEST_LEN+2+klen+REND_COOKIE_LEN; } else { /* Version 0. */ + + /* Some compilers are smart enough to work out that nickname can be more + * than 19 characters, when it's a hexdigest. They warn that strncpy() + * will truncate hexdigests without NUL-terminating them. But we only put + * hexdigests in HSDir and general circuit exits. */ + if (BUG(strlen(rendcirc->build_state->chosen_exit->nickname) + > MAX_NICKNAME_LEN)) { + goto perm_err; + } strncpy(tmp, rendcirc->build_state->chosen_exit->nickname, (MAX_NICKNAME_LEN+1)); /* nul pads */ memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie, |