summaryrefslogtreecommitdiff
path: root/src/or/policies.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/policies.c')
-rw-r--r--src/or/policies.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/policies.c b/src/or/policies.c
index 46a431a8de..e5af7887c7 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -1382,8 +1382,8 @@ parse_short_policy(const char *summary)
}
{
- size_t size = sizeof(short_policy_t) +
- sizeof(short_policy_entry_t)*(n_entries-1);
+ size_t size = STRUCT_OFFSET(short_policy_t, entries) +
+ sizeof(short_policy_entry_t)*(n_entries);
result = tor_malloc_zero(size);
tor_assert( (char*)&result->entries[n_entries-1] < ((char*)result)+size);