diff options
author | Amin Hassani <ahassani@google.com> | 2018-07-02 11:37:53 -0700 |
---|---|---|
committer | Amin Hassani <ahassani@google.com> | 2018-07-02 11:37:53 -0700 |
commit | 8a183d312c1c401d752f4be29fb52b004f071353 (patch) | |
tree | 23e60e6f9a85c8a97d188d1e45d42c125bd7e368 | |
parent | c82a7587b850ae43ba4bdb1d317e697642896215 (diff) | |
download | bsdiff-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.h | 2 |
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 |