aboutsummaryrefslogtreecommitdiff
path: root/src/Cache.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2021-02-18 20:28:59 +0100
committerVeikka Tuominen <git@vexu.eu>2021-02-21 12:19:03 +0200
commit057bf1afc9933e32bd35842d2464dab2164f06fb (patch)
treed2558c79df9c458d84a1c9c645cb7bcc3ed58ebe /src/Cache.zig
parent4272f07f668979bc356f117cdf12986a95402b43 (diff)
downloadzig-057bf1afc9933e32bd35842d2464dab2164f06fb.tar.gz
zig-057bf1afc9933e32bd35842d2464dab2164f06fb.zip
std: Add more error checking in hexToBytes
Prevent the function from turning into an endless loop that may or may not perform OOB accesses.
Diffstat (limited to 'src/Cache.zig')
-rw-r--r--src/Cache.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Cache.zig b/src/Cache.zig
index f5ffb34dbe..57ff9227fa 100644
--- a/src/Cache.zig
+++ b/src/Cache.zig
@@ -317,7 +317,7 @@ pub const Manifest = struct {
cache_hash_file.stat.size = fmt.parseInt(u64, size, 10) catch return error.InvalidFormat;
cache_hash_file.stat.inode = fmt.parseInt(fs.File.INode, inode, 10) catch return error.InvalidFormat;
cache_hash_file.stat.mtime = fmt.parseInt(i64, mtime_nsec_str, 10) catch return error.InvalidFormat;
- std.fmt.hexToBytes(&cache_hash_file.bin_digest, digest_str) catch return error.InvalidFormat;
+ _ = std.fmt.hexToBytes(&cache_hash_file.bin_digest, digest_str) catch return error.InvalidFormat;
if (file_path.len == 0) {
return error.InvalidFormat;