diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-09-17 14:51:43 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-09-17 14:51:43 +0300 |
commit | 585eaa123f21c4fed85865b938aeafac47730fec (patch) | |
tree | b6eaf236704293d0c291f1d587a2a4ed62ea920a /src/core/or | |
parent | a28a682a1fc89eb6f96b5397518c78b85dbf160d (diff) | |
parent | 34bab120df213970edf32db1f3462ff2585ee098 (diff) | |
download | tor-585eaa123f21c4fed85865b938aeafac47730fec.tar.gz tor-585eaa123f21c4fed85865b938aeafac47730fec.zip |
Merge branch 'tor-github/pr/1323'
Diffstat (limited to 'src/core/or')
-rw-r--r-- | src/core/or/connection_edge.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index 091d9c9b09..40d3351a82 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -2560,8 +2560,11 @@ destination_from_pf(entry_connection_t *conn, socks_request_t *req) } else if (proxy_sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)proxy_sa; pnl.af = AF_INET6; - memcpy(&pnl.saddr.v6, tor_addr_to_in6(&ENTRY_TO_CONN(conn)->addr), - sizeof(struct in6_addr)); + const struct in6_addr *dest_in6 = + tor_addr_to_in6(&ENTRY_TO_CONN(conn)->addr); + if (BUG(!dest_in6)) + return -1; + memcpy(&pnl.saddr.v6, dest_in6, sizeof(struct in6_addr)); pnl.sport = htons(ENTRY_TO_CONN(conn)->port); memcpy(&pnl.daddr.v6, &sin6->sin6_addr, sizeof(struct in6_addr)); pnl.dport = sin6->sin6_port; |