Protect against invalid punycode
* lisp/net/puny.el (puny-decode-string): Protect against invalid punycode.
This commit is contained in:
@@ -63,7 +63,10 @@ For instance, \"xn--ff-2sa.org\" => \"fśf.org\"."
|
||||
"Decode an IDNA/punycode-encoded string.
|
||||
For instance \"xn--bcher-kva\" => \"bücher\"."
|
||||
(if (string-match "\\`xn--" string)
|
||||
(puny-decode-string-internal (substring string 4))
|
||||
(condition-case nil
|
||||
(puny-decode-string-internal (substring string 4))
|
||||
;; If the string is invalid Punycode, just return the string.
|
||||
(args-out-of-range string))
|
||||
string))
|
||||
|
||||
(defconst puny-initial-n 128)
|
||||
|
||||
Reference in New Issue
Block a user