]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Bad arithmetic in talloc_page_aligned_pool
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 5 Aug 2018 23:05:18 +0000 (19:05 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 5 Aug 2018 23:05:18 +0000 (19:05 -0400)
src/lib/util/talloc.c

index 6605920f11b4e79e8cd427528b4112476037afd9..e2ce6ced439b75fac812021987697d858edbdc3b 100644 (file)
@@ -185,7 +185,7 @@ TALLOC_CTX *talloc_page_aligned_pool(TALLOC_CTX *ctx, void **start, void **end,
                talloc_free(pool);
                return NULL;
        }
-       hdr_size = (uintptr_t)pool - (uintptr_t)chunk;
+       hdr_size = (uintptr_t)chunk - (uintptr_t)pool;
 
        next = (void *)ROUND_UP((uintptr_t)chunk, page_size);   /* Round up address to the next page */