summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-03-07 17:16:43 +0200
committerEli Zaretskii <eliz@gnu.org>2019-03-07 17:16:43 +0200
commit2848623420e0478ae5ffda8d79af9fde0128dfbe (patch)
tree69391ad452e2c6df5f3c7c3cc9a3e39c458ac0cf
parentdbf1837940b090151b389235c1fc3617aef48234 (diff)
downloademacs-2848623420e0478ae5ffda8d79af9fde0128dfbe.tar.gz
Avoid undefined behavior in gdb-mi.el
* lisp/progmodes/gdb-mi.el (gdb-send): Don't call match-string if this is not a control command. (Bug#34769)
-rw-r--r--lisp/progmodes/gdb-mi.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index b63f82b7222..69eb29c5eb1 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1849,7 +1849,7 @@ commands to be prefixed by \"-interpreter-exec console\".")
;; Python and Guile commands that have an argument don't enter the
;; recursive reading loop.
(let* ((control-command-p (string-match gdb-control-commands-regexp string))
- (command-arg (match-string 3 string))
+ (command-arg (and control-command-p (match-string 3 string)))
(python-or-guile-p (string-match gdb-python-guile-commands-regexp
string)))
(if (and control-command-p