service: limit number of -connect-command flags
This commit is contained in:
parent
35b09f069c
commit
c7039da54b
@ -481,6 +481,9 @@ func (fs *networkFlagSet) update(network *Network) error {
|
||||
if len(fs.ConnectCommands) == 1 && fs.ConnectCommands[0] == "" {
|
||||
network.ConnectCommands = nil
|
||||
} else {
|
||||
if len(fs.ConnectCommands) > 20 {
|
||||
return fmt.Errorf("too many -connect-command flags supplied")
|
||||
}
|
||||
for _, command := range fs.ConnectCommands {
|
||||
_, err := irc.ParseMessage(command)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user