[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 19f7211: Protect against invalid punycode
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 19f7211: Protect against invalid punycode |
Date: |
Sun, 20 Oct 2019 03:40:20 -0400 (EDT) |
branch: master
commit 19f72110fc448e58dcd2d867d1db1fc547b790f2
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Protect against invalid punycode
* lisp/net/puny.el (puny-decode-string): Protect against invalid
punycode.
---
lisp/net/puny.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/net/puny.el b/lisp/net/puny.el
index 23c7af8..729076d 100644
--- a/lisp/net/puny.el
+++ b/lisp/net/puny.el
@@ -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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 19f7211: Protect against invalid punycode,
Lars Ingebrigtsen <=