Fix ruby-mode.el local command injection vulnerability (bug#60268)

* lisp/progmodes/ruby-mode.el
(ruby-find-library-file): Fix local command injection vulnerability.
This commit is contained in:
Xi Lu 2022-12-23 12:52:48 +08:00 committed by Dmitry Gutov
parent 4b44a395b3
commit 9a3b08061f

View file

@ -1899,7 +1899,7 @@ or `gem' statement around point."
(setq feature-name (read-string "Feature name: " init))))
(let ((out
(substring
(shell-command-to-string (concat "gem which " feature-name))
(shell-command-to-string (concat "gem which " (shell-quote-argument feature-name)))
0 -1)))
(if (string-match-p "\\`ERROR" out)
(user-error "%s" out)