From: Alan T. DeKok Date: Sun, 17 Apr 2022 05:59:46 +0000 (-0400) Subject: try to shut up coverity X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecda955caec880b1b23c613f882975455348e9b6;p=thirdparty%2Ffreeradius-server.git try to shut up coverity which thinks that fr_token_t can be between 0..63, instead of 0..48? --- diff --git a/src/lib/util/token.c b/src/lib/util/token.c index e45abcb899f..b330eaacefc 100644 --- a/src/lib/util/token.c +++ b/src/lib/util/token.c @@ -256,6 +256,12 @@ static fr_token_t getthing(char const **ptr, char *buf, int buflen, bool tok, strcpy(buf, tokenlist[i].name.str); p += tokenlist[i].name.len; + /* + * Try to shut up Coverity, which claims fr_token_t can be between 0..63, not + * 0..48??? + */ + if ((tokenlist[i].value < 0) || (tokenlist[i].value >= T_TOKEN_LAST)) return T_INVALID; + token = tokenlist[i].value; goto done; }