]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix buffer scoping in fr_pair_make
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 16 Jan 2018 00:00:40 +0000 (17:00 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 16 Jan 2018 00:02:50 +0000 (17:02 -0700)
src/lib/util/pair.c

index 689df2a0575e47c5e5bf4d467ee6e83127c111c5..2a0685006005b789fdb7d981cfe8579f10ea313f 100644 (file)
@@ -369,6 +369,7 @@ VALUE_PAIR *fr_pair_make(TALLOC_CTX *ctx, VALUE_PAIR **vps,
        char            *p;
        int8_t          tag;
        char const      *attrname = attribute;
+       char            buffer[FR_DICT_ATTR_MAX_NAME_LEN + 1 + 32];
 
        /*
         *    Check for tags in 'Attribute:Tag' format.
@@ -378,7 +379,6 @@ VALUE_PAIR *fr_pair_make(TALLOC_CTX *ctx, VALUE_PAIR **vps,
        p = strchr(attribute, ':');
        if (p) {
                char *end;
-               char buffer[FR_DICT_ATTR_MAX_NAME_LEN + 1 + 32];
 
                if (!p[1]) {
                        fr_strerror_printf("Invalid tag for attribute %s", attribute);