]> git.eshelyaron.com Git - emacs.git/commitdiff
Attempt to fix bug #17962 with SIGSEGV in display_line.
authorEli Zaretskii <eliz@gnu.org>
Sat, 12 Jul 2014 10:29:13 +0000 (13:29 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 12 Jul 2014 10:29:13 +0000 (13:29 +0300)
 src/xdisp.c (display_line): Don't call FETCH_BYTE with argument less than 1.

src/ChangeLog
src/xdisp.c

index 493bcde7418185fd99f26f75694f25433692fddb..9051d37fcefa66e8a2f087c16ec6e07c99e6ed64 100644 (file)
@@ -1,5 +1,8 @@
 2014-07-12  Eli Zaretskii  <eliz@gnu.org>
 
+       * xdisp.c (display_line): Don't call FETCH_BYTE with argument less
+       than 1.  (Bug#17962)
+
        * w32fns.c (Fx_file_dialog): Mention in the doc string the
        behavior on Windows 7 and later when the function is repeatedly
        invoked with the same value of DIR.  (Bug#17950)
index 61d1fa24c6855423f92099d1fb5f5ee0b9901682..6918c4360d41481d9eddcd0806e0fa0a6aa79008 100644 (file)
@@ -20512,7 +20512,10 @@ display_line (struct it *it)
          row->truncated_on_right_p = 1;
          it->continuation_lines_width = 0;
          reseat_at_next_visible_line_start (it, 0);
-         row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n';
+         if (IT_BYTEPOS (*it) <= BEG_BYTE)
+           row->ends_at_zv_p = true;
+         else
+           row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n';
          break;
        }
     }