From: Arran Cudbard-Bell Date: Fri, 26 May 2017 13:26:51 +0000 (-0400) Subject: CID 720453: Don't cast, so we restrict the range of values to the minimum and maximum... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=456951e02aa9b22e01284f4cc74463c9802eeac8;p=thirdparty%2Ffreeradius-server.git CID 720453: Don't cast, so we restrict the range of values to the minimum and maximum indecies of the array Hopefully coverity is smart enough to figure that out... Otherwise I guess we're checking the that uint8_t can't be bigger than UINT8_MAX :/ --- diff --git a/src/lib/util/pair.c b/src/lib/util/pair.c index 0b87f0a85e0..71fee115ac8 100644 --- a/src/lib/util/pair.c +++ b/src/lib/util/pair.c @@ -2532,7 +2532,7 @@ FR_TOKEN fr_pair_raw_from_str(char const **ptr, VALUE_PAIR_RAW *raw) * out which operators come after the attribute * name. Yes, our "lexer" is bad. */ - if (!fr_dict_attr_allowed_chars[(unsigned int) *t]) { + if (!fr_dict_attr_allowed_chars[*t]) { break; }