Skip to content

Commit b21b967

Browse files
authored
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 786641d 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
1 parent b6bbaa8 commit b21b967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/sys/zap_leaf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ typedef struct zap_leaf_phys {
132132
* with the ZAP_LEAF_CHUNK() macro.
133133
*/
134134

135-
uint16_t l_hash[1];
135+
uint16_t l_hash[];
136136
} zap_leaf_phys_t;
137137

138138
typedef union zap_leaf_chunk {

0 commit comments

Comments
 (0)