Skip to content

Commit

Permalink
Merge pull request #13694 from boltmark/fix-empty-remote-target-panic
Browse files Browse the repository at this point in the history
lxc: Add validation for non-empty remote address
  • Loading branch information
tomponline authored Jul 2, 2024
2 parents f116186 + 6a57144 commit 6545391
Show file tree
Hide file tree
Showing 41 changed files with 2,122 additions and 1,958 deletions.
4 changes: 4 additions & 0 deletions lxc/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ func (c *cmdRemoteAdd) run(cmd *cobra.Command, args []string) error {
addr = args[1]
}

if len(addr) == 0 {
return fmt.Errorf(i18n.G("Remote address must not be empty"))
}

// Validate the server name.
if strings.Contains(server, ":") {
return fmt.Errorf(i18n.G("Remote names may not contain colons"))
Expand Down
Loading

0 comments on commit 6545391

Please sign in to comment.