emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 2848623: Avoid undefined behavior in gdb-mi.el


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 2848623: Avoid undefined behavior in gdb-mi.el
Date: Thu, 7 Mar 2019 10:18:07 -0500 (EST)

branch: emacs-26
commit 2848623420e0478ae5ffda8d79af9fde0128dfbe
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 lisp/progmodes/gdb-mi.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index b63f82b..69eb29c 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]