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] == "" {
|
if len(fs.ConnectCommands) == 1 && fs.ConnectCommands[0] == "" {
|
||||||
network.ConnectCommands = nil
|
network.ConnectCommands = nil
|
||||||
} else {
|
} else {
|
||||||
|
if len(fs.ConnectCommands) > 20 {
|
||||||
|
return fmt.Errorf("too many -connect-command flags supplied")
|
||||||
|
}
|
||||||
for _, command := range fs.ConnectCommands {
|
for _, command := range fs.ConnectCommands {
|
||||||
_, err := irc.ParseMessage(command)
|
_, err := irc.ParseMessage(command)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user