From: Basil L. Contovounesios Date: Tue, 6 Jul 2021 00:05:41 +0000 (+0100) Subject: Avoid invalid regexp in wide docstring check X-Git-Tag: emacs-28.0.90~1938 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=044742bfe8c7c22e303242c40e16fbe9e564727a;p=emacs.git Avoid invalid regexp in wide docstring check * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Avoid constructing an invalid regexp during byte-compilation by limiting the number of columns to the current RE_DUP_MAX of 65535. This protects against pathological values of fill-column, for example (bug#49426). --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 70999648d47..6970c8a5055 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1627,7 +1627,7 @@ the `\\\\=[command]' ones that are assumed to be of length `byte-compile--wide-docstring-substitution-len'. Also ignore URLs." (string-match - (format "^.\\{%s,\\}$" (int-to-string (1+ col))) + (format "^.\\{%d,\\}$" (min (1+ col) #xffff)) ; Heed RE_DUP_MAX. (replace-regexp-in-string (rx (or ;; Ignore some URLs.