aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob N <rob.norris@klarasystems.com>2024-04-03 23:38:18 +0000
committerGitHub <noreply@github.com>2024-04-03 23:38:18 +0000
commitb21b967bd5095d431b71ef63f09e0d31c0ef0b08 (patch)
treefe2ce99e0ee1305185c5813a00ba9f353546e487
parentb6bbaa837271698f238a9264c4070416077fb67b (diff)
downloadsrc-b21b967bd5095d431b71ef63f09e0d31c0ef0b08.tar.gz
src-b21b967bd5095d431b71ef63f09e0d31c0ef0b08.zip
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 <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #15964
-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 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 {