summaryrefslogtreecommitdiff
path: root/src/stdmem.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-02-09 10:54:28 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2022-02-09 10:54:28 +0900
commit90f41a1898e421c04080d35d7fea98ee18e74865 (patch)
tree0741f789f0688322ad3ef16033230adf5f43fd2a /src/stdmem.c
parent6936f234220d12a87fe17f7fbdbb29ba9787dd95 (diff)
downloadlibgcrypt-90f41a1898e421c04080d35d7fea98ee18e74865.tar.gz
Fix memory allocation when GCRYCTL_ENABLE_M_GUARD.
* configure.ac: Add check for ALIGNOF_LONG_DOUBLE. * src/stdmem.c: Adjust EXTRA_ALIGN. -- GnuPG-bug-id: 5822 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'src/stdmem.c')
-rw-r--r--src/stdmem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stdmem.c b/src/stdmem.c
index 04ce64fb..f657ddcc 100644
--- a/src/stdmem.c
+++ b/src/stdmem.c
@@ -61,7 +61,9 @@
#define MAGIC_SEC_BYTE 0xcc
#define MAGIC_END_BYTE 0xaa
-#if SIZEOF_UNSIGNED_LONG == 8
+#ifdef ALIGNOF_LONG_DOUBLE
+#define EXTRA_ALIGN (ALIGNOF_LONG_DOUBLE-4)
+#elif SIZEOF_UNSIGNED_LONG == 8
#define EXTRA_ALIGN 4
#else
#define EXTRA_ALIGN 0