diff options
author | Richard Yao <[email protected]> | 2022-09-12 15:51:17 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-12 12:51:17 -0700 |
commit | e5327e7f9790ed7e884a7f8d9fa412632506b826 (patch) | |
tree | 4796bc18c78b7232cc060ef7ef0d46ccb9e4a27e /module/zfs/vdev_draid.c | |
parent | 7195c04d986ecd26c25c13e3c180790a2e85a723 (diff) |
vdev_draid_lookup_map() should not iterate outside draid_maps
Coverity reported this as an out-of-bounds read.
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Neal Gompa <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #13865
Diffstat (limited to 'module/zfs/vdev_draid.c')
-rw-r--r-- | module/zfs/vdev_draid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/vdev_draid.c b/module/zfs/vdev_draid.c index 24ea5d2cb..032e8825a 100644 --- a/module/zfs/vdev_draid.c +++ b/module/zfs/vdev_draid.c @@ -541,7 +541,7 @@ vdev_draid_generate_perms(const draid_map_t *map, uint8_t **permsp) int vdev_draid_lookup_map(uint64_t children, const draid_map_t **mapp) { - for (int i = 0; i <= VDEV_DRAID_MAX_MAPS; i++) { + for (int i = 0; i < VDEV_DRAID_MAX_MAPS; i++) { if (draid_maps[i].dm_children == children) { *mapp = &draid_maps[i]; return (0); |