diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-08-10 17:36:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-08-10 19:20:05 -0400 |
commit | e873c7e893987f5ad90ef401e6f986c62b4fc42d (patch) | |
tree | e9b50e142d2342643e74ba604e2f207b7ba528e3 | |
parent | 057f40f3d8e64389be40f26de6b634f2b8aab0d4 (diff) | |
download | tor-e873c7e893987f5ad90ef401e6f986c62b4fc42d.tar.gz tor-e873c7e893987f5ad90ef401e6f986c62b4fc42d.zip |
small code tweaks to try to work around debian stable complaints
-rw-r--r-- | src/feature/rend/rendclient.c | 4 | ||||
-rw-r--r-- | src/lib/net/address.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c index cde954da95..5c9dbea8e3 100644 --- a/src/feature/rend/rendclient.c +++ b/src/feature/rend/rendclient.c @@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc, > MAX_NICKNAME_LEN)) { goto perm_err; } - strncpy(tmp, rendcirc->build_state->chosen_exit->nickname, - (MAX_NICKNAME_LEN+1)); /* nul pads */ + strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname, + sizeof(tmp)); memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie, REND_COOKIE_LEN); dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN; diff --git a/src/lib/net/address.c b/src/lib/net/address.c index 076ca3eb34..69004ddb0e 100644 --- a/src/lib/net/address.c +++ b/src/lib/net/address.c @@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t len, int decorate) break; case AF_INET6: /* Shortest addr [ :: ] + \0 */ - if (len < (3 + (decorate ? 2 : 0))) + if (len < (3 + (decorate ? 2u : 0u))) return NULL; if (decorate) |