aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zen/cmds/builds_cmd.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 306702160..a5a3b03b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
##
- Bugfix: Parsing of `zen builds` `--log-progress` option fixed
+- Bugfix: Rebuild State phase of `zen builds download` could read out of bound for target path array
## 5.7.3
- Feature: `zen builds download` and `zen builds ls` now allows multiple wildcards for `--wildcard` and `--exclude-wildcard` separated by semicolons (;)
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp
index 437b061c8..508fbe8b4 100644
--- a/src/zen/cmds/builds_cmd.cpp
+++ b/src/zen/cmds/builds_cmd.cpp
@@ -8502,7 +8502,8 @@ namespace {
}
size_t TargetCount = 1;
- while (Targets[TargetOffset + TargetCount].RawHash == Targets[TargetOffset].RawHash)
+ while ((TargetOffset + TargetCount) < Targets.size() &&
+ (Targets[TargetOffset + TargetCount].RawHash == Targets[TargetOffset].RawHash))
{
TargetCount++;
}