summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-04-19 13:07:42 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2022-04-19 13:07:42 +0900
commit9e9f3073369905707b718aa1628d0fe5b1affed9 (patch)
tree95300f00c0743ffb81c520716582c0b105d28636 /src
parent51754fa2ed06cc41487324432dbea654642ef244 (diff)
downloadlibgcrypt-9e9f3073369905707b718aa1628d0fe5b1affed9.tar.gz
Use offsetof instead of null ptr calculation.
* src/secmem.c (_gcry_secmem_realloc_internal): Use offsetof. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'src')
-rw-r--r--src/secmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/secmem.c b/src/secmem.c
index b36c44f6..b66d66f9 100644
--- a/src/secmem.c
+++ b/src/secmem.c
@@ -809,7 +809,7 @@ _gcry_secmem_realloc_internal (void *p, size_t newsize, int xhint)
void *a;
mb = (memblock_t *) (void *) ((char *) p
- - ((size_t) &((memblock_t *) 0)->aligned.c));
+ - offsetof (memblock_t, aligned.c));
size = mb->size;
if (newsize < size)
{