summaryrefslogtreecommitdiffstats
path: root/routers/install/install.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-08-14 18:30:16 +0800
committerGitHub <noreply@github.com>2023-08-14 10:30:16 +0000
commited1be4ca68daa9782ea65135110799a4bf0697f8 (patch)
tree29d3465f32643df3e3d7f76e56e3dad4afb56b75 /routers/install/install.go
parentcafce3b4b5afb3f254a48e87f1516d7b5dc209b6 (diff)
downloadgitea-ed1be4ca68daa9782ea65135110799a4bf0697f8.tar.gz
gitea-ed1be4ca68daa9782ea65135110799a4bf0697f8.zip
Handle base64 decoding correctly to avoid panic (#26483)
Fix the panic if the "base64 secret" is too long.
Diffstat (limited to 'routers/install/install.go')
-rw-r--r--routers/install/install.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/install/install.go b/routers/install/install.go
index aa9c0f4986..99ea7b0738 100644
--- a/routers/install/install.go
+++ b/routers/install/install.go
@@ -415,7 +415,7 @@ func SubmitInstall(ctx *context.Context) {
cfg.Section("server").Key("LFS_START_SERVER").SetValue("true")
cfg.Section("lfs").Key("PATH").SetValue(form.LFSRootPath)
var lfsJwtSecret string
- if lfsJwtSecret, err = generate.NewJwtSecretBase64(); err != nil {
+ if _, lfsJwtSecret, err = generate.NewJwtSecretBase64(); err != nil {
ctx.RenderWithErr(ctx.Tr("install.lfs_jwt_secret_failed", err), tplInstall, &form)
return
}