From: Alan T. DeKok Date: Tue, 27 Dec 2022 13:43:22 +0000 (-0500) Subject: fr_dict_attr_by_oid() should parse the entire input string X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82b74eaf00af5062993f9bfa6ccc95544e02be4d;p=thirdparty%2Ffreeradius-server.git fr_dict_attr_by_oid() should parse the entire input string if it doesn't, then the input string contains a valid attribute, but then ends with an invalid character, or with an unknown attribute. --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index b345ca5d689..fbdb28a935f 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -1961,6 +1961,15 @@ fr_dict_attr_t const *fr_dict_attr_by_oid(fr_dict_attr_err_t *err, fr_dict_attr_ fr_dict_attr_by_oid_substr(err, &da, parent, &sbuff, NULL); if (err != FR_DICT_ATTR_OK) return NULL; + /* + * If we didn't parse the entire string, then the parsing stopped at an unknown child. + * e.g. Vendor-Specific.Cisco.Foo. In that case, the full attribute wasn't found. + */ + if (fr_sbuff_remaining(&sbuff) > 0) { + *err = FR_DICT_ATTR_NOTFOUND; + return NULL; + } + return da; }