]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't check if values are valid attribute names
authorAlan T. DeKok <aland@freeradius.org>
Sun, 4 Oct 2020 20:21:53 +0000 (16:21 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 4 Oct 2020 20:21:53 +0000 (16:21 -0400)
The VALUE parser in the dictionaries just strdup's the name.
So we shouldn't have more stringent checks here.

Embedded zeros, etc. should be taken care of by passing an
explicit length to fr_dict_enum_by_name()

src/lib/util/value.c

index 56cd1f1968cca751f6e5fa8dc618fe56f47001ec..53793c98c6bbf7ea1e32d043711077be2fdb1f57 100644 (file)
@@ -4194,18 +4194,6 @@ int fr_value_box_from_str(TALLOC_CTX *ctx, fr_value_box_t *dst,
                }
                fr_assert(name);
 
-               /*
-                *      Check the name name is valid first before bothering
-                *      to look it up.
-                *
-                *      Catches any embedded \0 bytes that might cause
-                *      incorrect results.
-                */
-               if (fr_dict_valid_name(name, name_len) <= 0) {
-                       if (tmp) talloc_free(tmp);
-                       goto parse;
-               }
-
                enumv = fr_dict_enum_by_name(dst_enumv, name, name_len);
                if (tmp) talloc_free(tmp);
                if (!enumv) goto parse;