mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-22 07:09:47 +00:00
ox-html: Fix stack overflow in regexp matching
* lisp/ox-html.el (org-html-fontify-code): Do not use [^\000] in regexps that may match large strings. Thanks to Kyle Machulis for reporting it.
This commit is contained in:
parent
ef6c1498b4
commit
36f5aa316f
@ -1478,10 +1478,10 @@ is the language used for CODE, as a string, or nil."
|
||||
;; Htmlize region.
|
||||
(org-html-htmlize-region-for-paste
|
||||
(point-min) (point-max))))
|
||||
;; Strip any encolosing <pre></pre> tags.
|
||||
(if (string-match "<pre[^>]*>\n*\\([^\000]*\\)</pre>" code)
|
||||
(match-string 1 code)
|
||||
code))))))))
|
||||
;; Strip any enclosing <pre></pre> tags.
|
||||
(let* ((beg (and (string-match "\\`<pre[^>]*>\n*" code) (match-end 0)))
|
||||
(end (and beg (string-match "</pre>\\'" code))))
|
||||
(if (and beg end) (substring code beg end) code)))))))))
|
||||
|
||||
(defun org-html-do-format-code
|
||||
(code &optional lang refs retain-labels num-start)
|
||||
|
Loading…
Reference in New Issue
Block a user