aboutsummaryrefslogtreecommitdiff
path: root/src/cache_hash.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-13 11:25:31 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-13 11:25:31 -0400
commitd332311e53a074eef77c61412ee59b5f5fdc3891 (patch)
tree7fd08ebf23634ef8fb76b1f59906a852d8faf5a9 /src/cache_hash.cpp
parente70c543bc4c097d7c3287feb0f233a13d4dc3829 (diff)
parente3f0ba4984f932cd3a9a99504d540b4cd8393364 (diff)
downloadzig-d332311e53a074eef77c61412ee59b5f5fdc3891.tar.gz
zig-d332311e53a074eef77c61412ee59b5f5fdc3891.zip
Merge branch 'kristate-cache-invalidformat-issue1510'
Diffstat (limited to 'src/cache_hash.cpp')
-rw-r--r--src/cache_hash.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cache_hash.cpp b/src/cache_hash.cpp
index b302946310..5b1f55686a 100644
--- a/src/cache_hash.cpp
+++ b/src/cache_hash.cpp
@@ -337,12 +337,12 @@ Error cache_hit(CacheHash *ch, Buf *out_digest) {
return ErrorInvalidFormat;
}
- Optional<Slice<uint8_t>> opt_file_path = SplitIterator_next(&it);
- if (!opt_file_path.is_some) {
+ Slice<uint8_t> file_path = SplitIterator_rest(&it);
+ if (file_path.len == 0) {
os_file_close(ch->manifest_file);
return ErrorInvalidFormat;
}
- Buf *this_path = buf_create_from_slice(opt_file_path.value);
+ Buf *this_path = buf_create_from_slice(file_path);
if (chf->path != nullptr && !buf_eql_buf(this_path, chf->path)) {
os_file_close(ch->manifest_file);
return ErrorInvalidFormat;