]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Enclose explicit loop case of fr_memset_secure() in block (#5126)
authorJames Jones <jejones3141@gmail.com>
Fri, 28 Jul 2023 19:01:16 +0000 (14:01 -0500)
committerGitHub <noreply@github.com>
Fri, 28 Jul 2023 19:01:16 +0000 (15:01 -0400)
Done because of the initial if statement, which makes the
explicit loop declaratons not be at the start of a block.

src/lib/util/misc.c

index b9f83820048e35df557a727f10011581cd3a7b69..1bb3bfd1205ba0cea2f9d8ac155c933cc9d5c642 100644 (file)
@@ -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
 }