mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 08:23:47 +01:00
bisync: fix endless loop if lockfile decoder errors
Before this change, the decoder looked only for `io.EOF`, and if any other error was returned, it could cause an infinite loop. This change fixes the issue by breaking for any non-nil error.
This commit is contained in:
parent
bef9fd0bc3
commit
04128f97ee
@ -99,7 +99,10 @@ func (b *bisyncRun) lockFileIsExpired() bool {
|
|||||||
b.handleErr(b.lockFile, "error reading lock file", err, true, true)
|
b.handleErr(b.lockFile, "error reading lock file", err, true, true)
|
||||||
dec := json.NewDecoder(rdf)
|
dec := json.NewDecoder(rdf)
|
||||||
for {
|
for {
|
||||||
if err := dec.Decode(&data); err == io.EOF {
|
if err := dec.Decode(&data); err != nil {
|
||||||
|
if err != io.EOF {
|
||||||
|
fs.Errorf(b.lockFile, "err: %v", err)
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user