From: Arran Cudbard-Bell Date: Mon, 5 Mar 2018 08:59:25 +0000 (+0600) Subject: Convert assert to runtime check X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45475cc8fe94972fbf5ee9e995fc0e8aaad3fbf0;p=thirdparty%2Ffreeradius-server.git Convert assert to runtime check --- diff --git a/src/lib/util/dict.c b/src/lib/util/dict.c index 428221ab2db..25fa177cdc4 100644 --- a/src/lib/util/dict.c +++ b/src/lib/util/dict.c @@ -4209,7 +4209,11 @@ fr_dict_enum_t *fr_dict_enum_by_value(fr_dict_t *dict, fr_dict_attr_t const *da, INTERNAL_IF_NULL(dict); - if (!fr_cond_assert(value->type == da->type)) return NULL; + /* + * Could be NULL or an unknown attribute, in which case + * we want to avoid the lookup gracefully... + */ + if (value->type != da->type) return NULL; /* * First, look up aliases.