Skip to content

Commit

Permalink
Be less picky about attribute names. Closes #796
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Sep 17, 2014
1 parent 97b8c9b commit 38541b4
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/lib/valuepair.c
Expand Up @@ -1975,21 +1975,12 @@ FR_TOKEN pairread(char const **ptr, VALUE_PAIR_RAW *raw)
return T_INVALID;
}

/*
* Only ASCII is allowed, and only a subset of that.
*/
if ((*t < 32) || (*t >= 128)) {
invalid:
fr_strerror_printf("Invalid attribute name");
return T_INVALID;
}

/*
* This is arguably easier than trying to figure
* out which operators come after the attribute
* name. Yes, our "lexer" is bad.
*/
if (!dict_attr_allowed_chars[(int) *t]) {
if (!dict_attr_allowed_chars[(unsigned int) *t]) {
break;
}

Expand All @@ -2008,9 +1999,12 @@ FR_TOKEN pairread(char const **ptr, VALUE_PAIR_RAW *raw)
}

/*
* ASCII, but not a valid attribute name.
* Haven't found any valid characters in the name.
*/
if (!*raw->l_opand) goto invalid;
if (!*raw->l_opand) {
fr_strerror_printf("Invalid attribute name");
return T_INVALID;
}

/*
* Look for tag (:#). This is different from :=, which
Expand Down

0 comments on commit 38541b4

Please sign in to comment.