diff -u vte-0.17.1/debian/changelog vte-0.17.1/debian/changelog --- vte-0.17.1/debian/changelog +++ vte-0.17.1/debian/changelog @@ -1,3 +1,9 @@ +vte (1:0.17.1-0ubuntu1andersk1) intrepid; urgency=low + + * Fix crash when selecting text (Closes LP: #256769). + + -- Anders Kaseorg Wed, 13 Aug 2008 22:09:19 -0400 + vte (1:0.17.1-0ubuntu1) intrepid; urgency=low * New upstream release only in patch2: unchanged: --- vte-0.17.1.orig/debian/patches/99_fix_select_crash.patch +++ vte-0.17.1/debian/patches/99_fix_select_crash.patch @@ -0,0 +1,82 @@ +Index: ChangeLog +=================================================================== +--- ChangeLog (revision 2082) ++++ ChangeLog (working copy) +@@ -1,3 +1,16 @@ ++2008-08-13 Behdad Esfahbod ++ ++ Bug 546940 – Crash when selecting text ++ ++ * src/vte.c (vte_terminal_extend_selection): Fix crash with 64-bit ++ systems. Note to self: ++ ++ unsigned int len = 0; ++ long i = len - 1; ++ assert (i < 0); ++ ++ fails on 64-bit systems. ++ + 2008-08-05 Behdad Esfahbod + + Released vte-0.17.1. +Index: src/vte.c +=================================================================== +--- src/vte.c (revision 2082) ++++ src/vte.c (working copy) +@@ -6025,7 +6025,8 @@ vte_terminal_extend_selection(VteTermina + { + VteScreen *screen; + VteRowData *rowdata; +- long delta, height, width, i, j, last_nonempty; ++ long delta, height, width, j; ++ guint i; + struct vte_charcell *cell; + struct selection_event_coords *origin, *last, *start, *end; + struct selection_cell_coords old_start, old_end, *sc, *ec, tc; +@@ -6141,9 +6142,9 @@ vte_terminal_extend_selection(VteTermina + rowdata = _vte_terminal_find_row_data(terminal, sc->y); + if (rowdata != NULL) { + /* Find the last non-empty character on the first line. */ +- for (i = rowdata->cells->len - 1; i >= 0; i--) { ++ for (i = rowdata->cells->len; i > 0; i--) { + cell = &g_array_index(rowdata->cells, +- struct vte_charcell, i); ++ struct vte_charcell, i - 1); + if (cell->attr.fragment || cell->c != 0) + break; + } +@@ -6151,13 +6152,13 @@ vte_terminal_extend_selection(VteTermina + * startpoint up to the beginning of the next line + * unless that would move the startpoint after the end + * point, or we're in select-by-line mode. */ +- if ((sc->x > i) && ++ if ((sc->x >= i) && + (terminal->pvt->selection_type != selection_type_line)) { + if (sc->y < ec->y) { + sc->x = 0; + sc->y++; + } else { +- sc->x = i + 1; ++ sc->x = i; + } + } + } else { +@@ -6172,15 +6173,15 @@ vte_terminal_extend_selection(VteTermina + rowdata = _vte_terminal_find_row_data(terminal, ec->y); + if (rowdata != NULL) { + /* Find the last non-empty character on the last line. */ +- for (i = rowdata->cells->len - 1; i >= 0; i--) { ++ for (i = rowdata->cells->len; i > 0; i--) { + cell = &g_array_index(rowdata->cells, +- struct vte_charcell, i); ++ struct vte_charcell, i - 1); + if (cell->attr.fragment || cell->c != 0) + break; + } + /* If the end point is to its right, then extend the + * endpoint as far right as we can expect. */ +- if (ec->x > i) { ++ if (ec->x >= i) { + ec->x = MAX(ec->x, + MAX(terminal->column_count - 1, + rowdata->cells->len)); \ No newline at end of file