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 | 1a3f9f377ca616ec408fdcd9e64b9f75e4a46fb6 (patch) | |
tree | 861f5ab9fc53db33b8817cc331ba1e1fd90b4c1d | |
parent | 340607639c23452e6b3b401c3fb4b08db6240413 (diff) | |
parent | df18cf0e8fa9195df82bef9535f920ad913efab7 (diff) | |
download | tor-1a3f9f377ca616ec408fdcd9e64b9f75e4a46fb6.tar.gz tor-1a3f9f377ca616ec408fdcd9e64b9f75e4a46fb6.zip |
Merge branch 'maint-0.3.3' into release-0.3.3
-rw-r--r-- | changes/bug27463 | 3 | ||||
-rw-r--r-- | src/or/rendclient.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/changes/bug27463 b/changes/bug27463 new file mode 100644 index 0000000000..073acdd997 --- /dev/null +++ b/changes/bug27463 @@ -0,0 +1,3 @@ + o Minor bugfixes (onion services): + - Silence a spurious compiler warning in rend_client_send_introduction(). + Fixes bug 27463; bugfix on 0.1.1.2-alpha. diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 57815815b9..e61207f2ee 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -238,6 +238,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, |