aboutsummaryrefslogtreecommitdiffstats
path: root/services/doctor
diff options
context:
space:
mode:
authorcoldWater <forsaken628@gmail.com>2024-03-19 10:20:36 +0800
committerGitHub <noreply@github.com>2024-03-19 02:20:36 +0000
commit0e183d81fc5283f9d2047472de580e4f04a046c1 (patch)
tree8f08d554fb9ed6c2f48d2e77e61f1ac348b76155 /services/doctor
parent1f0d31ce8fdfc8c32f84e4e0801c2d04b727bbd8 (diff)
downloadgitea-0e183d81fc5283f9d2047472de580e4f04a046c1.tar.gz
gitea-0e183d81fc5283f9d2047472de580e4f04a046c1.zip
Fix missing error check of bufio.Scanner (#29882)
maybe more
Diffstat (limited to 'services/doctor')
-rw-r--r--services/doctor/authorizedkeys.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/doctor/authorizedkeys.go b/services/doctor/authorizedkeys.go
index d5a96605b9..bc0266c4bc 100644
--- a/services/doctor/authorizedkeys.go
+++ b/services/doctor/authorizedkeys.go
@@ -51,6 +51,10 @@ func checkAuthorizedKeys(ctx context.Context, logger log.Logger, autofix bool) e
}
linesInAuthorizedKeys.Add(line)
}
+ err = scanner.Err()
+ if err != nil {
+ return fmt.Errorf("scan: %w", err)
+ }
f.Close()
// now we regenerate and check if there are any lines missing