emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 044742b: Avoid invalid regexp in wide docstring check


From: Basil L. Contovounesios
Subject: master 044742b: Avoid invalid regexp in wide docstring check
Date: Tue, 6 Jul 2021 14:13:10 -0400 (EDT)

branch: master
commit 044742bfe8c7c22e303242c40e16fbe9e564727a
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    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).
---
 lisp/emacs-lisp/bytecomp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 7099964..6970c8a 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]