aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2023-09-06 13:50:27 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2023-09-09 08:26:33 +0000
commitcbf1bbe5c8b5afedff247dbc20f4bccd888a06e9 (patch)
tree3abec390a25e1cfa0810df99452c57e654b13390
parent70e76f81e594e108054446bfc890eeaeace5a839 (diff)
downloadsrc-cbf1bbe5c8b5afedff247dbc20f4bccd888a06e9.tar.gz
src-cbf1bbe5c8b5afedff247dbc20f4bccd888a06e9.zip
__crt_aligned_alloc_offset(): fix ov_index for backing allocation address
(cherry picked from commit 03a7c36ddbc0ddb1063d2c8a37c64d83e1519c55)
-rw-r--r--libexec/rtld-elf/rtld_malloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c
index 6e011e88ba5a..4b5140551675 100644
--- a/libexec/rtld-elf/rtld_malloc.c
+++ b/libexec/rtld-elf/rtld_malloc.c
@@ -188,7 +188,7 @@ __crt_aligned_alloc_offset(size_t align, size_t size, size_t offset)
x += offset;
ov = cp2op((void *)x);
ov1.ov_magic = AMAGIC;
- ov1.ov_index = x - (uintptr_t)mem - sizeof(union overhead);
+ ov1.ov_index = x - (uintptr_t)mem + sizeof(union overhead);
memcpy(ov, &ov1, sizeof(ov1));
return ((void *)x);
}