diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-06-05 21:07:58 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-06-05 21:12:55 +0100 |
commit | 940dace9cff6f44e051632e12b51cef23f19de1f (patch) | |
tree | a919e5316146d52f9218ffd0e6d33f3c665f3575 /gdb | |
parent | 982a38f60b0ece9385556cff45567e06710478cb (diff) | |
download | gdb-940dace9cff6f44e051632e12b51cef23f19de1f.zip gdb-940dace9cff6f44e051632e12b51cef23f19de1f.tar.gz gdb-940dace9cff6f44e051632e12b51cef23f19de1f.tar.bz2 |
Revert "gdb/python: Avoid use after free in py-tui.c"
This reverts commit 982a38f60b0ece9385556cff45567e06710478cb.
I missed that the title being assigned too was a std::string, and so
there is no leak.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/python/py-tui.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1d486c4..5cd74e6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-06-05 Andrew Burgess <andrew.burgess@embecosm.com> + Revert commit 982a38f60b0. + * python/py-tui.c (gdbpy_tui_set_title): Restore use of get. + +2020-06-05 Andrew Burgess <andrew.burgess@embecosm.com> + * python/py-tui.c (gdbpy_tui_set_title): Use release, not get, to avoid use after free. diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c index f2c0339..ca88f85 100644 --- a/gdb/python/py-tui.c +++ b/gdb/python/py-tui.c @@ -433,7 +433,7 @@ gdbpy_tui_set_title (PyObject *self, PyObject *newvalue, void *closure) if (value == nullptr) return -1; - win->window->title = value.release (); + win->window->title = value.get (); return 0; } |