From 1e13b390db6902b59f3735e058f464bf1a5ae663 Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Tue, 29 Jul 2025 06:30:50 +0200 Subject: [PATCH] OPENSSL_malloc.pod: tfix, wfix in OPENSSL_aligned_alloc description MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Eugene Syromiatnikov Reviewed-by: Saša Nedvědický Reviewed-by: Matt Caswell Reviewed-by: Paul Dale Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/28059) --- doc/man3/OPENSSL_malloc.pod | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/man3/OPENSSL_malloc.pod b/doc/man3/OPENSSL_malloc.pod index 5f6c9d3c8bf..6e8d350dd30 100644 --- a/doc/man3/OPENSSL_malloc.pod +++ b/doc/man3/OPENSSL_malloc.pod @@ -122,19 +122,19 @@ OPENSSL_malloc(), OPENSSL_realloc(), and OPENSSL_free() are like the C malloc(), realloc(), and free() functions. OPENSSL_zalloc() calls memset() to zero the memory before returning. -OPENSSL_aligned_alloc() operates just as OPENSSL_malloc does, but it +OPENSSL_aligned_alloc() operates just as OPENSSL_malloc() does, but it allows for the caller to specify an alignment value, for instances in -which the default alignment of malloc is insufficient for the callers +which the default alignment of malloc is insufficient for the caller's needs. Note, the alignment value must be a power of 2, and the size specified must be a multiple of the alignment. NOTE: The call to OPENSSL_aligned_alloc() accepts a 3rd argument, I which must point to a void pointer. On some platforms, there is no available -library call to obtain memory allocations greater than what malloc provides. In -this case, OPENSSL_aligned_alloc implements its own alignment routine, -allocating additional memory and offsetting the returned pointer to be on the -requested alignment boundary. In order to safely free allocations made by this -method, the caller must return the value in the I variable, rather than -the returned pointer. +library call to obtain memory allocations with alignment greater than what +malloc provides. In this case, OPENSSL_aligned_alloc() implements its own +alignment routine, allocating additional memory and offsetting the returned +pointer to be on the requested alignment boundary. In order to safely free +allocations made by this method, the caller must return the value +in the I variable, rather than the returned pointer. OPENSSL_clear_realloc() and OPENSSL_clear_free() should be used when the buffer at B holds sensitive information. -- 2.47.3