From: James Jones Date: Fri, 28 Jul 2023 19:01:16 +0000 (-0500) Subject: Enclose explicit loop case of fr_memset_secure() in block (#5126) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e452e03be38775ebd2a83adfb947f4c43a448c0f;p=thirdparty%2Ffreeradius-server.git Enclose explicit loop case of fr_memset_secure() in block (#5126) Done because of the initial if statement, which makes the explicit loop declaratons not be at the start of a block. --- diff --git a/src/lib/util/misc.c b/src/lib/util/misc.c index b9f83820048..1bb3bfd1205 100644 --- a/src/lib/util/misc.c +++ b/src/lib/util/misc.c @@ -481,11 +481,13 @@ void fr_memset_secure(void *ptr, size_t len) explicit_bzero(ptr, len); #else - volatile unsigned char *volatile p = (volatile unsigned char *volatile) ptr; - size_t i = len; - - while (i--) { - *(p++) = 0; + { + volatile unsigned char *volatile p = (volatile unsigned char *volatile) ptr; + size_t i = len; + + while (i--) { + *(p++) = 0; + } } #endif }