Skip to content

Commit

Permalink
Merge pull request thestinger#546 from ThrosturX/master
Browse files Browse the repository at this point in the history
fixed a segfault on attempting to open a void selection in a newly op…
  • Loading branch information
jelly authored Dec 1, 2017
2 parents 1f9ab29 + 06170ca commit 86db8ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions termite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,13 @@ static void move_to_row_start(VteTerminal *vte, select_info *select, long row) {
}

static void open_selection(char *browser, VteTerminal *vte) {
// If the terminal has been opened, but no selection has ever been made
// , a segfault will occur upon attempting to make the unique pointer
// within vte_terminal_get_selection(vte) (unless if there is no browser).
if (!vte_terminal_get_has_selection(vte)) {
g_printerr("no selection to open\n");
return
}
if (browser) {
auto selection = make_unique(vte_terminal_get_selection(vte), g_free);
if (selection && *selection) {
Expand Down

0 comments on commit 86db8ab

Please sign in to comment.