diff options
author | rl1987 <rl1987@users.noreply.github.com> | 2020-05-21 14:17:15 +0300 |
---|---|---|
committer | rl1987 <rl1987@users.noreply.github.com> | 2020-05-21 14:17:15 +0300 |
commit | a5d28bf88f839c21fbefde8391d777fd9610abd3 (patch) | |
tree | 0d136fa3df36dba4cfdd230c0cb1b1d98456a0bd /src/core/or/connection_edge.c | |
parent | ded99992b831bfff782a3b3c612297a4634d3d88 (diff) | |
download | tor-a5d28bf88f839c21fbefde8391d777fd9610abd3.tar.gz tor-a5d28bf88f839c21fbefde8391d777fd9610abd3.zip |
Check for NULL from tor_dup_ip()
Diffstat (limited to 'src/core/or/connection_edge.c')
-rw-r--r-- | src/core/or/connection_edge.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index 5c9bf64e8e..fc77db8334 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -3459,8 +3459,9 @@ tell_controller_about_resolved_result(entry_connection_t *conn, expires = time(NULL) + ttl; if (answer_type == RESOLVED_TYPE_IPV4 && answer_len >= 4) { char *cp = tor_dup_ip(ntohl(get_uint32(answer))); - control_event_address_mapped(conn->socks_request->address, - cp, expires, NULL, 0); + if (cp) + control_event_address_mapped(conn->socks_request->address, + cp, expires, NULL, 0); tor_free(cp); } else if (answer_type == RESOLVED_TYPE_HOSTNAME && answer_len < 256) { char *cp = tor_strndup(answer, answer_len); |