]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check return code of fr_dict_attr_by_oid_substr()
authorAlan T. DeKok <aland@freeradius.org>
Thu, 26 Oct 2023 12:08:32 +0000 (08:08 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 27 Oct 2023 00:06:43 +0000 (20:06 -0400)
which can return an error even if the "err" ptr is NULL

src/lib/util/dict_util.c

index e760f9a7af043a2b97476484de8baf5056701574..9f5f18f28074c572ae070cffcaaff716ba0a2d66 100644 (file)
@@ -1995,7 +1995,7 @@ fr_dict_attr_t const *fr_dict_attr_by_oid(fr_dict_attr_err_t *err, fr_dict_attr_
        fr_sbuff_t              sbuff = FR_SBUFF_IN(oid, strlen(oid));
        fr_dict_attr_t const    *da;
 
-       fr_dict_attr_by_oid_substr(err, &da, parent, &sbuff, NULL);
+       if (fr_dict_attr_by_oid_substr(err, &da, parent, &sbuff, NULL) <= 0) return NULL;
        if (err && *err != FR_DICT_ATTR_OK) return NULL;
 
        /*