aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zdb
diff options
context:
space:
mode:
authorGvozden Neskovic <[email protected]>2016-08-04 16:23:35 +0200
committerBrian Behlendorf <[email protected]>2016-08-16 14:53:09 -0700
commitf0c26069bdf4ec675c840f0932fcfe7d4036d06f (patch)
treed8f55e6202142fa2db9f7fcb9adef5173cb169a3 /cmd/zdb
parentfc897b24b2efafccb5c9e915b81dc5f797673e72 (diff)
zdb: fencepost error at zdb_cb.zcb_embedded_histogram[][]
Erroneous access detected by gcc UndefinedBehaviorSanitizer: `zdb.c:2424:7: runtime error: index 112 out of bounds for type 'uint64_t [112]'` Fix: increase histogram size by 1 to accommodate all possible sizes. Signed-off-by: Gvozden Neskovic <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4934 Issue #4883
Diffstat (limited to 'cmd/zdb')
-rw-r--r--cmd/zdb/zdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index 5a196c452..6a076e65d 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -2354,7 +2354,7 @@ typedef struct zdb_cb {
uint64_t zcb_dedup_blocks;
uint64_t zcb_embedded_blocks[NUM_BP_EMBEDDED_TYPES];
uint64_t zcb_embedded_histogram[NUM_BP_EMBEDDED_TYPES]
- [BPE_PAYLOAD_SIZE];
+ [BPE_PAYLOAD_SIZE + 1];
uint64_t zcb_start;
uint64_t zcb_lastprint;
uint64_t zcb_totalasize;