]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't use variable out of scope. CID #1503994
authorAlan T. DeKok <aland@freeradius.org>
Mon, 11 Apr 2022 23:56:39 +0000 (19:56 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 11 Apr 2022 23:56:39 +0000 (19:56 -0400)
src/lib/util/md4.c
src/lib/util/md5.c

index 3eb8f1f1cff07dfe2c9040e9c494e6a853e41cb9..b5564f72eb4799fc57eb4979685d38aa97914d6a 100644 (file)
@@ -362,6 +362,8 @@ static void fr_md4_local_ctx_free(fr_md4_ctx_t **ctx)
        *ctx = NULL;
 }
 
+static const uint8_t *zero = (uint8_t[]){ 0x00 };
+
 /** @copydoc fr_md4_update
  *
  */
@@ -377,7 +379,7 @@ static void fr_md4_local_update(fr_md4_ctx_t *ctx, uint8_t const *in, size_t inl
         *      NULL pointers.
         */
        if (!in) {
-               in = (uint8_t[]){ 0x00 };
+               in = zero;
                inlen = 0;
        }
 
index e7434a20e53d9d0eb85e90012f5f71902858fce1..c3c60049cd3a1776740782409276b17294411651 100644 (file)
@@ -357,6 +357,8 @@ static void fr_md5_local_ctx_free(fr_md5_ctx_t **ctx)
        *ctx = NULL;
 }
 
+static const uint8_t *zero = (uint8_t[]){ 0x00 };
+
 /** @copydoc fr_md5_update
  *
  */
@@ -373,7 +375,7 @@ static void fr_md5_local_update(fr_md5_ctx_t *ctx, uint8_t const *in, size_t inl
         *      NULL pointers.
         */
        if (!in) {
-               in = (uint8_t[]){ 0x00 };
+               in = zero;
                inlen = 0;
        }