summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2022-09-12 15:54:43 -0400
committerTony Hutter <[email protected]>2022-12-01 12:39:40 -0800
commit792825724b69a32b55199acc4c6a2980b656c232 (patch)
treed70b5a0ab775f75a8b1a4c401531b2f7eed5f76a /lib
parentab22031d79691a25d5be20244ad72e34c05d9973 (diff)
zpool_load_compat() should create strings of length ZFS_MAXPROPLEN
Otherwise, `strlcat()` can overflow them. Coverity found this. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Neal Gompa <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #13866
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_pool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index c6884538d..e2912cdb9 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -4788,8 +4788,8 @@ zpool_load_compat(const char *compat, boolean_t *features, char *report,
for (uint_t i = 0; i < SPA_FEATURES; i++)
features[i] = B_TRUE;
- char err_badfile[1024] = "";
- char err_badtoken[1024] = "";
+ char err_badfile[ZFS_MAXPROPLEN] = "";
+ char err_badtoken[ZFS_MAXPROPLEN] = "";
/*
* We ignore errors from the directory open()