From 48b0cefb29b67cee2171a9eacda9f06f8380b02b Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Tue, 14 Sep 2021 18:03:14 +0300 Subject: [PATCH] Pull request: home: fix install panic Closes #3596. Squashed commit of the following: commit e14f8795859cf775b360d4fe2f5c1d0eebb87ba6 Author: Ainar Garipov Date: Tue Sep 14 17:49:48 2021 +0300 home: fix install panic --- CHANGELOG.md | 7 ++++--- internal/home/controlinstall.go | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc424dee..db8d8dc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,8 +49,8 @@ and this project adheres to - The `systemd` service script will now create the `/var/log` directory when it doesn't exist ([#3579]). -- Items in allowed clients, disallowed clients, and blocked hosts lists must - be unique ([#3419]). +- Items in allowed clients, disallowed clients, and blocked hosts lists are now + required to be unique ([#3419]). - The TLS private key previously saved as a string isn't shown in API responses anymore ([#1898]). - Better OpenWrt detection ([#3435]). @@ -115,7 +115,8 @@ In this release, the schema version has changed from 10 to 12. ### Fixed -- Panic when upstream server responds with empty question section ([#3551]). +- Panic when an upstream server responds with an empty question section + ([#3551]). - 9GAG blocking ([#3564]). - DHCP now follows RFCs more closely when it comes to response sending and option selection ([#3443], [#3538]). diff --git a/internal/home/controlinstall.go b/internal/home/controlinstall.go index bafa0060..1f54a645 100644 --- a/internal/home/controlinstall.go +++ b/internal/home/controlinstall.go @@ -257,7 +257,8 @@ type applyConfigReq struct { Password string `json:"password"` } -// Copy installation parameters between two configuration objects +// copyInstallSettings copies the installation parameters between two +// configuration structures. func copyInstallSettings(dst, src *configuration) { dst.BindHost = src.BindHost dst.BindPort = src.BindPort @@ -307,7 +308,7 @@ func (web *Web) handleInstallConfigure(w http.ResponseWriter, r *http.Request) { return } - var curConfig *configuration + curConfig := &configuration{} copyInstallSettings(curConfig, config) Context.firstRun = false