repository: reject key and config files that are too short (#21977)

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
This commit is contained in:
Arpit Jain
2026-07-22 20:38:07 +00:00
committed by GitHub
parent d4088aa09b
commit 8baffc4027
4 changed files with 65 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
Bugfix: Report an error instead of crashing on a truncated key or config file
Restic crashed with a slice bounds panic when a repository contained a key
file or a config file that was shorter than the encryption overhead, for
example after an upload was interrupted. Since every command has to read a
key file, the whole repository became unusable until the file was removed.
Restic now reports that the file is too short instead.
https://github.com/restic/restic/pull/21977