Skip to content

Commit 3f51b97

Browse files
committed
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. Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/
1 parent 8cd8ccc commit 3f51b97

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)