diff options
| author | Eshel Yaron | 2025-03-28 17:57:35 +0100 |
|---|---|---|
| committer | Eshel Yaron | 2025-04-05 08:04:55 +0200 |
| commit | 3ee021dc19e314f6f456867ec43c25aed5cc41b8 (patch) | |
| tree | 3902934ac3623fd0ec730090bb721a42e29911e0 | |
| parent | cd41247dc18f4e478ffb296198229ee22d44668c (diff) | |
| download | emacs-3ee021dc19e314f6f456867ec43c25aed5cc41b8.tar.gz emacs-3ee021dc19e314f6f456867ec43c25aed5cc41b8.zip | |
; (find-function-search-for-symbol): Be cautious with macros.
* lisp/emacs-lisp/find-func.el
(find-function-search-for-symbol): Only attempt to expand
macros in trusted buffers. (Bug#77341)
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 8f488a9c00a..6bdfb4bc38b 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -487,11 +487,14 @@ The search is done in the source for library LIBRARY." | |||
| 487 | ;; If the regexp search didn't find the location of | 487 | ;; If the regexp search didn't find the location of |
| 488 | ;; the symbol (for example, because it is generated by | 488 | ;; the symbol (for example, because it is generated by |
| 489 | ;; a macro), try a slightly more expensive search that | 489 | ;; a macro), try a slightly more expensive search that |
| 490 | ;; expands macros until it finds the symbol. | 490 | ;; expands macros until it finds the symbol. Since |
| 491 | ;; macro-expansion involves arbitrary code execution, | ||
| 492 | ;; only attempt it in trusted buffers. | ||
| 491 | (cons (current-buffer) | 493 | (cons (current-buffer) |
| 492 | (find-function--search-by-expanding-macros | 494 | (when (trusted-content-p) |
| 493 | (current-buffer) symbol type | 495 | (find-function--search-by-expanding-macros |
| 494 | form-matcher-factory)))))))))) | 496 | (current-buffer) symbol type |
| 497 | form-matcher-factory))))))))))) | ||
| 495 | 498 | ||
| 496 | ;;;###autoload | 499 | ;;;###autoload |
| 497 | (defun find-function-update-type-alist (symbol type variable) | 500 | (defun find-function-update-type-alist (symbol type variable) |