passing hints as a const pointer to sandbox_getaddrinfo(), also one tor_free macro fails to compile..

This commit is contained in:
Cristian Toader 2013-09-06 12:39:56 +03:00
parent 839ff0063d
commit 6a22b29641
3 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -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;
}

View File

@ -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. */