]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Annotate bogus overflow complaint (CID 1604606)
authorJames Jones <jejones3141@gmail.com>
Fri, 28 Jun 2024 15:43:05 +0000 (10:43 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Sep 2024 18:27:38 +0000 (12:27 -0600)
Coverity complains about "mask <<= 1", but mask has an unsigned
type, so that's perfectly valid and its behavior defined.

src/lib/util/calc.c

index 264ce3dd04a3ef5029c4ee5e4ac6734e5de87df2..f09bd928f46f6bb114fb76b50d69e0cac54ad958 100644 (file)
@@ -1330,6 +1330,7 @@ static int calc_ipv4_prefix(UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_valu
                                if (mask == b->vb_uint32) break;
 
                                prefix--;
+                               /* coverity[overflow_const] */
                                mask <<= 1;
                        }
                        fr_assert(prefix > 0);