aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-11-18 12:10:52 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-11-18 12:10:52 +0100
commitacf381b061cd52abe737a306821bbb137bc132d7 (patch)
treee54570fc65e6312517056637a9aa392ab3f1fbc4 /src
parent205655e98b88c501a889479b083913b159a6981e (diff)
parentbc14465e08a286f8bc3b1e47e70372352b64bd2c (diff)
Merge branch 'faridzakaria/fix-stack-buffer-overflow' of https://github.com/fzakaria/nix
Diffstat (limited to 'src')
-rw-r--r--src/libstore/references.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/references.cc b/src/libstore/references.cc
index c369b14ac..bb9590acb 100644
--- a/src/libstore/references.cc
+++ b/src/libstore/references.cc
@@ -54,7 +54,7 @@ void RefScanSink::operator () (std::string_view data)
fragment, so search in the concatenation of the tail of the
previous fragment and the start of the current fragment. */
auto s = tail;
- s.append(data.data(), refLength);
+ s.append(data.data(), std::min(data.size(), refLength));
search(s, hashes, seen);
search(data, hashes, seen);