[PATCH] Bail early if password-cmd returns no data
Export this patch
---
config.go | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/config.go b/config.go
index d9bfe33..f35da54 100644
--- a/config.go
+++ b/config.go
@@ -218,9 +218,10 @@ func unmarshal(filename string, cfg *Config) (err error) {
}
passCmdOut := strings.Split(string(stdout), "\n")
- if len(passCmdOut) >= 1 {
- cfg.Password = &passCmdOut[0]
+ if len(passCmdOut) < 1 || strings.TrimSpace(passCmdOut[0]) == "" {
+ return fmt.Errorf("password command returned no data")
}
+ cfg.Password = &passCmdOut[0]
case "channel":
// TODO: does this work with soju.im/bouncer-networks extension?
cfg.Channels = append(cfg.Channels, d.Params...)
--
2.42.0
Hi,
Thanks for your patch.
Applied and pushed. :-)
To git.sr.ht:~taiite/senpai
1a2bb12..1a5a19c master -> master