From 88b05287d7eaca274304e855371e596380953fc0 Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Thu, 18 Jan 2024 16:14:11 +0300 Subject: [PATCH] Pull request 2129: 6644-fix-nil-deref Updates #6644. Co-authored-by: Eugene Burkov Squashed commit of the following: commit a79f4a35f811ab85302d266839f55143afc6fff8 Author: Stanislav Chzhen Date: Wed Jan 17 19:53:58 2024 +0300 all: upd chlog commit 9106dfb65dcfbbe40a0c97964279e8c35d4c8c00 Author: Stanislav Chzhen Date: Wed Jan 17 19:43:34 2024 +0300 home: fix nil deref --- CHANGELOG.md | 2 ++ internal/home/home.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbc875db..0e07c78d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ In this release, the schema version has changed from 27 to 28. ### Fixed +- Panic on using `--no-etc-hosts` flag ([#6644]). - Schedule display in the client settings after creating or updating. - Zero value in `querylog.size_memory` disables logging ([#6570]). - Non-anonymized IP addresses on the dashboard ([#6584]). @@ -95,6 +96,7 @@ In this release, the schema version has changed from 27 to 28. [#6570]: https://github.com/AdguardTeam/AdGuardHome/issues/6570 [#6574]: https://github.com/AdguardTeam/AdGuardHome/issues/6574 [#6584]: https://github.com/AdguardTeam/AdGuardHome/issues/6584 +[#6644]: https://github.com/AdguardTeam/AdGuardHome/issues/6644 [wiki-config]: https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration diff --git a/internal/home/home.go b/internal/home/home.go index f0a037c0..701e4820 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -360,6 +360,11 @@ func setupDNSFilteringConf(conf *filtering.Config) (err error) { ) conf.EtcHosts = Context.etcHosts + // TODO(s.chzhen): Use empty interface. + if Context.etcHosts == nil { + conf.EtcHosts = nil + } + conf.ConfigModified = onConfigModified conf.HTTPRegister = httpRegister conf.DataDir = Context.getDataDir()