mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
dsl_prop_known_index(): check for invalid prop
Resolve UBSAN array-index-out-of-bounds error in zprop_desc_t. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: szubersk <szuberskidamian@gmail.com> Closes #14142 Closes #14147
This commit is contained in:
committed by
Brian Behlendorf
parent
8c0684d326
commit
0f4ee295ba
@@ -75,7 +75,8 @@ static int
|
||||
dsl_prop_known_index(zfs_prop_t prop, uint64_t value)
|
||||
{
|
||||
const char *str = NULL;
|
||||
if (zfs_prop_get_type(prop) == PROP_TYPE_INDEX)
|
||||
if (prop != ZPROP_CONT && prop != ZPROP_INVAL &&
|
||||
zfs_prop_get_type(prop) == PROP_TYPE_INDEX)
|
||||
return (!zfs_prop_index_to_string(prop, value, &str));
|
||||
|
||||
return (-1);
|
||||
|
||||
Reference in New Issue
Block a user