mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-17 01:30:34 +00:00
caddyhttp: Minor cleanup and fix nil pointer deref in caddyfile adapter
This commit is contained in:
@@ -56,6 +56,10 @@ func cmdHashPassword(fs caddycmd.Flags) (int, error) {
|
||||
plaintext := []byte(fs.String("plaintext"))
|
||||
salt := []byte(fs.String("salt"))
|
||||
|
||||
if len(plaintext) == 0 {
|
||||
return caddy.ExitCodeFailedStartup, fmt.Errorf("password is required")
|
||||
}
|
||||
|
||||
var hash []byte
|
||||
var err error
|
||||
switch algorithm {
|
||||
|
||||
Reference in New Issue
Block a user