summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmin Hassani <ahassani@google.com>2018-07-02 11:37:53 -0700
committerAmin Hassani <ahassani@google.com>2018-07-02 11:37:53 -0700
commit8a183d312c1c401d752f4be29fb52b004f071353 (patch)
tree23e60e6f9a85c8a97d188d1e45d42c125bd7e368
parentc82a7587b850ae43ba4bdb1d317e697642896215 (diff)
downloadbsdiff-8a183d312c1c401d752f4be29fb52b004f071353.tar.gz
Fixes a stack-use-after-scope sanitizer issue
We kept a const referenced copy of the sink file in the SinkFile class, Change it to just keep a copy. Bug: crbug.com/849192 Test: USE="asan fuzzer" emerge-amd64-generic bsdiff && ASAN_OPTIONS=log_path=stderr /build/amd64-generic/usr/libexec/fuzzers/bspatch_fuzzer ./clusterfuzz-testcase-minimized-bspatch_fuzzer-5673050675347456 Change-Id: Ia583620d337a780c202cdb07233317ecb3fe26c8
-rw-r--r--sink_file.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sink_file.h b/sink_file.h
index e2c69d8..ebec522 100644
--- a/sink_file.h
+++ b/sink_file.h
@@ -33,7 +33,7 @@ class SinkFile : public FileInterface {
private:
// The sink() function used to write data.
- const sink_func& sink_;
+ const sink_func sink_;
};
} // namespace bsdiff