aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorRob N <[email protected]>2024-04-04 10:38:18 +1100
committerGitHub <[email protected]>2024-04-03 16:38:18 -0700
commitb21b967bd5095d431b71ef63f09e0d31c0ef0b08 (patch)
treefe2ce99e0ee1305185c5813a00ba9f353546e487 /include/sys
parentb6bbaa837271698f238a9264c4070416077fb67b (diff)
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #15964
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/zap_leaf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sys/zap_leaf.h b/include/sys/zap_leaf.h
index d563edd7b..e54456d34 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 {