mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 11:29:36 +03:00
Suppress Clang Static Analyzer warning about SNPRINTF_BLKPTR()
Clang's static analyzer pointed out that if we can pass a -1 array index to copyname[copies] if there are no valid DVAs. This is an absurd situation, but it suggests that we are missing an assertion, so we add it. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14575
This commit is contained in:
parent
a4240a8ac7
commit
0b831cabc6
@ -663,6 +663,7 @@ typedef struct blkptr {
|
|||||||
(u_longlong_t)DVA_GET_ASIZE(dva), \
|
(u_longlong_t)DVA_GET_ASIZE(dva), \
|
||||||
ws); \
|
ws); \
|
||||||
} \
|
} \
|
||||||
|
ASSERT3S(copies, >, 0); \
|
||||||
if (BP_IS_ENCRYPTED(bp)) { \
|
if (BP_IS_ENCRYPTED(bp)) { \
|
||||||
len += func(buf + len, size - len, \
|
len += func(buf + len, size - len, \
|
||||||
"salt=%llx iv=%llx:%llx%c", \
|
"salt=%llx iv=%llx:%llx%c", \
|
||||||
|
Loading…
Reference in New Issue
Block a user