diff options
| author | David McFarland | 2017-12-30 13:14:32 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-12-30 13:14:32 +0200 |
| commit | 30ffc256abe7443a02b44490c518baf9a122b4c8 (patch) | |
| tree | 2c7b2c5af1d58339a40271e707b869e8d1eb65db | |
| parent | fb20043b2fec8e8aff6354ec1396fd5ba688b76b (diff) | |
| download | emacs-30ffc256abe7443a02b44490c518baf9a122b4c8.tar.gz emacs-30ffc256abe7443a02b44490c518baf9a122b4c8.zip | |
Fix regex stack overflow in gdb-mi.el when parsing complex locals
* lisp/progmodes/gdb-mi.el (gdb-jsonify-buffer): Skip string
literals with (forward-sexp) instead of matching with regex.
(Bug#29868)
Copyright-paperwork-exempt: yes
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 58552759b95..84b8c6b44b1 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -2717,10 +2717,10 @@ If `default-directory' is remote, full file names are adapted accordingly." | |||
| 2717 | (insert "]")))))) | 2717 | (insert "]")))))) |
| 2718 | (goto-char (point-min)) | 2718 | (goto-char (point-min)) |
| 2719 | (insert "{") | 2719 | (insert "{") |
| 2720 | (let ((re (concat "\\([[:alnum:]-_]+\\)=\\({\\|\\[\\|\"\"\\|" | 2720 | (let ((re (concat "\\([[:alnum:]-_]+\\)="))) |
| 2721 | gdb--string-regexp "\\)"))) | ||
| 2722 | (while (re-search-forward re nil t) | 2721 | (while (re-search-forward re nil t) |
| 2723 | (replace-match "\"\\1\":\\2" nil nil))) | 2722 | (replace-match "\"\\1\":" nil nil) |
| 2723 | (if (eq (char-after) ?\") (forward-sexp) (forward-char)))) | ||
| 2724 | (goto-char (point-max)) | 2724 | (goto-char (point-max)) |
| 2725 | (insert "}"))) | 2725 | (insert "}"))) |
| 2726 | 2726 | ||