summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2020-04-23 15:54:38 -0700
committerGitHub <[email protected]>2020-04-23 15:54:38 -0700
commit6de3e59bdd70fc9db5d3ef2549a49264845c937e (patch)
tree4f609129b329e243dad60ab5e19eb9b31c942833
parent5d4ed9614fad523fafd6e8a7705847b624a005fe (diff)
Fix unitialized variable in `zstream redup` command
Fix uninitialized variable in `zstream redup` command. The compiler may determine the 'stream_offset' variable can be uninitialized because not all rdt_lookup() exit paths set it. This should never happen in practice as documented by the assert, but initialize it regardless to resolve the warning. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10241 Closes #10244
-rw-r--r--cmd/zstream/zstream_redup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zstream/zstream_redup.c b/cmd/zstream/zstream_redup.c
index 9ed8df337..379025ce5 100644
--- a/cmd/zstream/zstream_redup.c
+++ b/cmd/zstream/zstream_redup.c
@@ -308,7 +308,7 @@ zfs_redup_stream(int infd, int outfd, boolean_t verbose)
* record with the found WRITE record, but with
* drr_object,drr_offset,drr_toguid replaced with ours.
*/
- uint64_t stream_offset;
+ uint64_t stream_offset = 0;
rdt_lookup(&rdt, drrwb.drr_refguid,
drrwb.drr_refobject, drrwb.drr_refoffset,
&stream_offset);