]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid undefined behavior in gdb-mi.el
authorEli Zaretskii <eliz@gnu.org>
Thu, 7 Mar 2019 15:16:43 +0000 (17:16 +0200)
committerEli Zaretskii <eliz@gnu.org>
Thu, 7 Mar 2019 15:16:43 +0000 (17:16 +0200)
* lisp/progmodes/gdb-mi.el (gdb-send): Don't call match-string
if this is not a control command.  (Bug#34769)

lisp/progmodes/gdb-mi.el

index b63f82b7222ed0c2c1e08a6f871ff3165bfdd9bb..69eb29c5eb1ec704f5b24fdcc9809dafda73f1e7 100644 (file)
@@ -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