# HG changeset patch # User Gerd Moellmann # Date 992860902 0 # Node ID 8757fe98656e259bc8774c5392bd6c2198b033fb # Parent 1dd1f9ddca4caf474f61c7902441c1508e60fdd1 (Ffind_composition_internal): Check POS for validity. diff -r 1dd1f9ddca4c -r 8757fe98656e src/composite.c --- a/src/composite.c Mon Jun 18 10:21:59 2001 +0000 +++ b/src/composite.c Mon Jun 18 10:41:42 2001 +0000 @@ -777,8 +777,18 @@ } 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;