diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-04-07 11:10:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-04-07 11:10:14 -0400 |
commit | 39c057d45a67f9aa80bc05df85ec8deafdb6f46a (patch) | |
tree | cf03c9607a75a34281d1f69841fcd4ea47c2c02e /src/common/memarea.c | |
parent | ad4ff7a5b93a9236b6084548798815540ad91cbe (diff) | |
download | tor-39c057d45a67f9aa80bc05df85ec8deafdb6f46a.tar.gz tor-39c057d45a67f9aa80bc05df85ec8deafdb6f46a.zip |
memarea: Don't assume that sizeof(ulong) >= sizeof(void*).
Fixes bug 18716; bugfix on 0.2.1.1-alpha where memarea.c was
introduced. Found by wbenny.
Diffstat (limited to 'src/common/memarea.c')
-rw-r--r-- | src/common/memarea.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/memarea.c b/src/common/memarea.c index 6841ba54e7..6c7e4c7d64 100644 --- a/src/common/memarea.c +++ b/src/common/memarea.c @@ -22,9 +22,9 @@ #define MEMAREA_ALIGN SIZEOF_VOID_P #if MEMAREA_ALIGN == 4 -#define MEMAREA_ALIGN_MASK 3lu +#define MEMAREA_ALIGN_MASK ((uintptr_t)3) #elif MEMAREA_ALIGN == 8 -#define MEMAREA_ALIGN_MASK 7lu +#define MEMAREA_ALIGN_MASK ((uintptr_t)7) #else #error "void* is neither 4 nor 8 bytes long. I don't know how to align stuff." #endif |