ui/termstatus: fix race condition in StdioWrapper

This commit is contained in:
Michael Eischer
2025-03-23 20:04:45 +01:00
parent 1221453d08
commit ec19d67512
3 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
Bugfix: Fix rare crash in command output
Some commands could in rare cases crash when trying to print status messages
and request retries at the same time. This resulted in an error like the following:
```
panic: runtime error: slice bounds out of range [468:156]
[...]
github.com/restic/restic/internal/ui/termstatus.(*lineWriter).Write(...)
/restic/internal/ui/termstatus/stdio_wrapper.go:36 +0x136
```
This has been fixed.
https://github.com/restic/restic/issues/5259
https://github.com/restic/restic/pull/5300