diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-04-10 20:37:51 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-04-10 20:37:51 +0300 |
| commit | 4c6be9cb63ff66ce49a6f733c1e00d1889f2c95f (patch) | |
| tree | 898854069101e6616620e2bd732a48e5eca08fd2 /common/pmem.c | |
| parent | 8aa17b12f29536ea9c8b6ca22c7f153e8d90fa3b (diff) | |
| download | kmi-4c6be9cb63ff66ce49a6f733c1e00d1889f2c95f.tar.gz kmi-4c6be9cb63ff66ce49a6f733c1e00d1889f2c95f.zip | |
add basic ubsan and fix issues reported by it
Diffstat (limited to 'common/pmem.c')
| -rw-r--r-- | common/pmem.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/pmem.c b/common/pmem.c index 6ef89bc..e3e5e5c 100644 --- a/common/pmem.c +++ b/common/pmem.c @@ -236,6 +236,7 @@ static pm_t __populate_order(mm_node_t **op, pm_t cont, enum mm_order src, o->entries = num; o->full = (mm_info_t *)move_forward(cont, state_elems(num)); + cont = align_up(cont, sizeof(void *)); o->next = (mm_node_t **)move_forward(cont, next_elems(num)); memset(o->full, 0, state_elems(num)); memset(o->next, 0, next_elems(num)); @@ -260,6 +261,7 @@ static pm_t __probe_order(pm_t cont, enum mm_order src, enum mm_order dst, cont += sizeof(struct mm_branch_t); cont += state_elems(num); + cont = align_up(cont, sizeof(void *)); cont += next_elems(num); for (size_t i = 0; i < num; ++i) |
