diff options
author | Cristian Toader <cristian.matei.toader@gmail.com> | 2013-09-06 12:39:56 +0300 |
---|---|---|
committer | Cristian Toader <cristian.matei.toader@gmail.com> | 2013-09-06 12:39:56 +0300 |
commit | 6a22b29641834cecb446282588f9d47d8678b8b4 (patch) | |
tree | 0ea7aa0a7137fec7f88cbff2588a3cef0257c966 /src/common | |
parent | 839ff0063d3fca10a64abf69ab27d1fd88456889 (diff) | |
download | tor-6a22b29641834cecb446282588f9d47d8678b8b4.tar.gz tor-6a22b29641834cecb446282588f9d47d8678b8b4.zip |
passing hints as a const pointer to sandbox_getaddrinfo(), also one tor_free macro fails to compile..
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/address.c | 2 | ||||
-rw-r--r-- | src/common/sandbox.c | 6 | ||||
-rw-r--r-- | src/common/sandbox.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/common/address.c b/src/common/address.c index a46aeb0d45..f9647b9a90 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -235,7 +235,7 @@ tor_addr_lookup(const char *name, uint16_t family, tor_addr_t *addr) memset(&hints, 0, sizeof(hints)); hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; - err = sandbox_getaddrinfo(name, hints, &res); + err = sandbox_getaddrinfo(name, &hints, &res); if (!err) { best = NULL; for (res_p = res; res_p; res_p = res_p->ai_next) { diff --git a/src/common/sandbox.c b/src/common/sandbox.c index 7e77ea1766..e936b62135 100644 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@ -728,7 +728,7 @@ prot_strings(sandbox_cfg_t* cfg) memcpy(pr_mem_next, param_val, param_size); // re-point el parameter to protected - tor_free((char*) ((smp_param_t*)el->param)->value); + free((char*)((smp_param_t*)el->param)->value); ((smp_param_t*)el->param)->value = (intptr_t) pr_mem_next; ((smp_param_t*)el->param)->prot = 1; @@ -949,7 +949,7 @@ sandbox_cfg_allow_execve_array(sandbox_cfg_t **cfg, ...) } int -sandbox_getaddrinfo(const char *name, struct addrinfo hints, +sandbox_getaddrinfo(const char *name, const struct addrinfo *hints, struct addrinfo **res) { sb_addr_info_t *el; @@ -969,7 +969,7 @@ sandbox_getaddrinfo(const char *name, struct addrinfo hints, } if (!sandbox_active) { - if (getaddrinfo(name, NULL, &hints, res)) { + if (getaddrinfo(name, NULL, hints, res)) { log_err(LD_BUG,"(Sandbox) getaddrinfo failed!"); return -1; } diff --git a/src/common/sandbox.h b/src/common/sandbox.h index 503bb70846..ed9caa1686 100644 --- a/src/common/sandbox.h +++ b/src/common/sandbox.h @@ -133,7 +133,7 @@ typedef struct { int sandbox_add_addrinfo(const char *addr); /** Replacement for getaddrinfo(), using pre-recorded results. */ -int sandbox_getaddrinfo(const char *name, struct addrinfo hints, +int sandbox_getaddrinfo(const char *name, const struct addrinfo *hints, struct addrinfo **res); /** Use <b>fd</b> to log non-survivable sandbox violations. */ |