]> code.delx.au - gnu-emacs/blobdiff - src/intervals.c
(init_from_display_pos): Don't read past end of
[gnu-emacs] / src / intervals.c
index 33ef9a3417740701322f05f05cedfd3205604535..a822dafefcf801c890f069f14863f206b5682e5d 100644 (file)
@@ -2275,6 +2275,10 @@ move_if_not_intangible (position)
          pos = Fnext_char_property_change (pos, Qnil);
 
     }
+  else if (position < BEGV)
+    position = BEGV;
+  else if (position > ZV)
+    position = ZV;
 
   /* If the whole stretch between PT and POSITION isn't intangible,
      try moving to POSITION (which means we actually move farther