diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2022-04-19 13:07:42 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2022-04-19 13:07:42 +0900 |
commit | 9e9f3073369905707b718aa1628d0fe5b1affed9 (patch) | |
tree | 95300f00c0743ffb81c520716582c0b105d28636 | |
parent | 51754fa2ed06cc41487324432dbea654642ef244 (diff) | |
download | libgcrypt-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>
-rw-r--r-- | src/secmem.c | 2 |
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) { |