summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--strings/ctype-tis620.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index d5181dc4db0..7628b425b65 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -492,7 +492,7 @@ static uchar* thai2sortable(const uchar * tstr,uint len)
}
pLeft4 = pRight4;*/
while(len--) {
- if(isldvowel(*p) && isconsnt(p[1])) {
+ if(isldvowel(*p) && len > 0 && isconsnt(p[1])) {
*pRight1++ = t_ctype[p[1]][0];
*pRight2++ = t_ctype[p[1]][1];
*pRight3++ = t_ctype[p[1]][2];