This is an automated email from the ASF dual-hosted git repository.
zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new bfc6a1dae6 Fix t3c generate nil panic on bad input (#6987)
bfc6a1dae6 is described below
commit bfc6a1dae6f1c8b834ca57412957ff5d49acd1ff
Author: Robert O Butts <[email protected]>
AuthorDate: Wed Jul 27 16:56:16 2022 -0600
Fix t3c generate nil panic on bad input (#6987)
---
cache-config/t3c-generate/t3c-generate.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cache-config/t3c-generate/t3c-generate.go
b/cache-config/t3c-generate/t3c-generate.go
index 1bdc474666..9211c8ade4 100644
--- a/cache-config/t3c-generate/t3c-generate.go
+++ b/cache-config/t3c-generate/t3c-generate.go
@@ -77,7 +77,10 @@ func main() {
os.Exit(config.ExitCodeErrGeneric)
}
- if toData.Server.HostName == nil {
+ if toData.Server == nil {
+ log.Errorln("input had no server")
+ os.Exit(config.ExitCodeErrGeneric)
+ } else if toData.Server.HostName == nil {
log.Errorln("input server had no host name")
os.Exit(config.ExitCodeErrGeneric)
}