From dd6f28023d432785758b7e5ac12f0b1748fbdea7 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 30 Dec 2007 13:42:10 +0000 Subject: [PATCH] (get_char_property_and_overlay): Signal error if POSITION is out of range in a buffer. --- src/ChangeLog | 5 +++++ src/textprop.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index ec82db08df4..cc29a16b1d0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-12-30 Richard Stallman + + * textprop.c (get_char_property_and_overlay): + Signal error if POSITION is out of range in a buffer. + 2007-12-29 Martin Rudalics * w32fns.c (Fx_create_frame): Make copy of frame parameters diff --git a/src/textprop.c b/src/textprop.c index f7b50755ed1..6c1470735bd 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -646,6 +646,10 @@ get_char_property_and_overlay (position, prop, object, overlay) Lisp_Object *overlay_vec; struct buffer *obuf = current_buffer; + if (XINT (position) < BUF_BEGV (XBUFFER (object)) + || XINT (position) > BUF_ZV (XBUFFER (object))) + xsignal1 (Qargs_out_of_range, position); + set_buffer_temp (XBUFFER (object)); GET_OVERLAYS_AT (XINT (position), overlay_vec, noverlays, NULL, 0); -- 2.39.2