mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-09-20 04:56:21 +02:00
Use tor_strdup() in place of malloc+strncpy+terminate.
This commit is contained in:
parent
8accf71c44
commit
0015d00842
@ -512,14 +512,7 @@ do_resolve(const char *hostname,
|
||||
domainname_t *dn =
|
||||
socks5_server_reply_get_bind_addr_domainname(reply);
|
||||
|
||||
size_t result_len = (size_t)domainname_get_len(dn);
|
||||
|
||||
*result_hostname = tor_malloc(result_len+1);
|
||||
|
||||
strncpy(*result_hostname, (char *)domainname_getstr_name(dn),
|
||||
result_len);
|
||||
|
||||
(*result_hostname)[result_len] = '\0';
|
||||
*result_hostname = tor_strdup(domainname_getstr_name(dn));
|
||||
}
|
||||
|
||||
socks5_server_reply_free(reply);
|
||||
|
Loading…
Reference in New Issue
Block a user