From 96344ff00349422172de6fa57899c66dc3c00391 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 19 Mar 2018 15:56:20 -0600 Subject: [PATCH] optgroup: add check for optgroup bit numbers being within range Signed-off-by: Jens Axboe --- optgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/optgroup.c b/optgroup.c index 122d24e9..1c418f5a 100644 --- a/optgroup.c +++ b/optgroup.c @@ -1,6 +1,7 @@ #include #include #include "optgroup.h" +#include "compiler/compiler.h" /* * Option grouping @@ -203,3 +204,5 @@ const struct opt_group *opt_group_cat_from_mask(uint64_t *mask) { return group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID); } + +compiletime_assert(__FIO_OPT_G_NR <= 8 * sizeof(uint64_t), "__FIO_OPT_G_NR"); -- 2.25.1