Better fix for bug #1990430.

This commit is contained in:
Karl Waclawek 2008-06-13 13:18:44 +00:00
parent 5d3f2b833e
commit a247ccd476

View File

@ -1744,12 +1744,10 @@ PREFIX(updatePosition)(const ENCODING *enc,
const char *end, const char *end,
POSITION *pos) POSITION *pos)
{ {
while (ptr != end) { while (ptr < end) {
switch (BYTE_TYPE(enc, ptr)) { switch (BYTE_TYPE(enc, ptr)) {
#define LEAD_CASE(n) \ #define LEAD_CASE(n) \
case BT_LEAD ## n: \ case BT_LEAD ## n: \
if (end - ptr < n) \
return; \
ptr += n; \ ptr += n; \
break; break;
LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)