From e3b3e3271489eda3e7f2a3fd404dced8fbb10d60 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 18 Jun 2001 10:41:42 +0000 Subject: [PATCH] (Ffind_composition_internal): Check POS for validity. --- src/composite.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/composite.c b/src/composite.c index 9ff5f855bed..6f60ddbca5a 100644 --- a/src/composite.c +++ b/src/composite.c @@ -777,8 +777,18 @@ See `find-composition' for more detail.") } else end = -1; + if (!NILP (string)) - CHECK_STRING (string, 2); + { + CHECK_STRING (string, 2); + if (XINT (pos) < 0 || XINT (pos) >= XSTRING (string)->size) + args_out_of_range (string, pos); + } + else + { + if (XINT (pos) < BEGV || XINT (pos) >= ZV) + args_out_of_range (Fcurrent_buffer (), pos); + } if (!find_composition (start, end, &start, &end, &prop, string)) return Qnil; -- 2.39.2