]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
hoist variables so that they're not over-written
authorAlan T. DeKok <aland@freeradius.org>
Wed, 23 Jul 2025 14:36:48 +0000 (16:36 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 23 Jul 2025 14:36:48 +0000 (16:36 +0200)
src/modules/rlm_dpsk/rlm_dpsk.c

index 9eeff00a344761a0a4e433b439b33a61145f4f52..4c6eee45407d5bf7c0fe256c86dd87795c6feb3e 100644 (file)
@@ -301,6 +301,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, REQUEST *re
        eapol_attr_t const *eapol;
        eapol_attr_t *zeroed;
        FILE *fp = NULL;
+       char const *filename;
        char const *psk_identity = NULL, *psk = NULL;
        uint8_t *p;
        uint8_t const *snonce, *ap_mac;
@@ -311,6 +312,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, REQUEST *re
        uint8_t digest[EVP_MAX_MD_SIZE], mic[EVP_MAX_MD_SIZE];
        char token_identity[256];
        char token_psk[256];
+       char filename_buffer[1024];
 
        /*
         *      Search for the information in a bunch of attributes.
@@ -516,10 +518,9 @@ stage2:
         */
        if (inst->filename) {
                FR_TOKEN token;
-               char const *q, *filename;
+               char const *q;
                char token_mac[256];
                char buffer[1024];
-               char filename_buffer[1024];
 
                if (!inst->dynamic) {
                        filename = inst->filename;