Browse Source

validate that passphrases are valid as non-final IRC parameters

tags/v2.6.0-rc1
Shivaram Lingamneni 3 years ago
parent
commit
d7ba478519
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      irc/accounts.go

+ 5
- 1
irc/accounts.go View File

@@ -479,7 +479,11 @@ func validatePassphrase(passphrase string) error {
479 479
 	if passphrase == "*" {
480 480
 		return errAccountBadPassphrase
481 481
 	}
482
-	// for now, just enforce that spaces are not allowed
482
+	// validate that the passphrase contains no spaces, and furthermore is valid as a
483
+	// non-final IRC parameter. we already checked that it is nonempty:
484
+	if passphrase[0] == ':' {
485
+		return errAccountBadPassphrase
486
+	}
483 487
 	for _, r := range passphrase {
484 488
 		if unicode.IsSpace(r) {
485 489
 			return errAccountBadPassphrase

Loading…
Cancel
Save