diff options
author | Cristian Toader <cristian.matei.toader@gmail.com> | 2013-08-28 19:56:42 +0300 |
---|---|---|
committer | Cristian Toader <cristian.matei.toader@gmail.com> | 2013-08-28 19:56:42 +0300 |
commit | 8b8f87a06ad5f18460012d0a0b4ceaa119bbccd3 (patch) | |
tree | 21a682b24fd211a3cb4d06917a1615a83a67f669 /src | |
parent | b121ca581d8a2390f6aa61f6537a1884cd268c44 (diff) | |
download | tor-8b8f87a06ad5f18460012d0a0b4ceaa119bbccd3.tar tor-8b8f87a06ad5f18460012d0a0b4ceaa119bbccd3.tar.gz |
removed PARAM_LEN
Diffstat (limited to 'src')
-rw-r--r-- | src/common/sandbox.c | 9 | ||||
-rw-r--r-- | src/common/sandbox.h | 3 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c index 50d6f99b9..8ef8757cb 100644 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@ -669,7 +669,7 @@ sandbox_intern_string(const char *param) return NULL; for (elem = filter_dynamic; elem != NULL; elem = elem->next) { - if (elem->prot && !strncmp(param, (char*)(elem->param), MAX_PARAM_LEN)) { + if (elem->prot && !strcmp(param, (char*)(elem->param))) { return (char*)(elem->param); } } @@ -688,10 +688,7 @@ prot_strdup(char* str) goto out; // allocating protected memory region for parameter - param_size = 1 + strnlen(str, MAX_PARAM_LEN); - if (param_size == MAX_PARAM_LEN) { - log_warn(LD_BUG, "(Sandbox) Parameter length too large!"); - } + param_size = 1 + strlen(str); res = (char*) mmap(NULL, param_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); @@ -903,7 +900,7 @@ sandbox_getaddrinfo(const char *name, struct addrinfo **res) return -1; } - if (strncmp(name, hname, sizeof(hname)) || sb_addr_info == NULL) { + if (strcmp(name, hname) || sb_addr_info == NULL) { log_err(LD_BUG,"(Sandbox) failed for hname %s!", name); return -1; } diff --git a/src/common/sandbox.h b/src/common/sandbox.h index 6cb827e26..a844fc554 100644 --- a/src/common/sandbox.h +++ b/src/common/sandbox.h @@ -36,9 +36,6 @@ #include <seccomp.h> #include <netdb.h> -/** Security measure for filter string parameter lengths*/ -#define MAX_PARAM_LEN 64 - #define PARAM_PTR 0 #define PARAM_NUM 1 |