From b21b967bd5095d431b71ef63f09e0d31c0ef0b08 Mon Sep 17 00:00:00 2001 From: Rob N Date: Thu, 4 Apr 2024 10:38:18 +1100 Subject: [PATCH] zap_leaf: make l_hash[] variable length to silence UBSAN When UBSAN is active and OpenZFS is a debug build, the l_hash assert at the bottom of zap_open_leaf() causes UBSAN to complain. This follows the example in 786641dcf to shut it up. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Rob Norris Closes #15964 --- include/sys/zap_leaf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys/zap_leaf.h b/include/sys/zap_leaf.h index d563edd7ba59..e54456d3472b 100644 --- a/include/sys/zap_leaf.h +++ b/include/sys/zap_leaf.h @@ -132,7 +132,7 @@ typedef struct zap_leaf_phys { * with the ZAP_LEAF_CHUNK() macro. */ - uint16_t l_hash[1]; + uint16_t l_hash[]; } zap_leaf_phys_t; typedef union zap_leaf_chunk {