]> granicus.if.org Git - onig/commitdiff
fix heap-buffer-overflow
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 13 Aug 2019 04:37:30 +0000 (13:37 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Tue, 13 Aug 2019 23:41:44 +0000 (08:41 +0900)
src/regexec.c

index 0753b070b8521bd4c7d7ccf7c0b8da76ee9ecf50..634ee4221b142cdfa0a4e24186b6ebff197a72ed 100644 (file)
@@ -4196,6 +4196,7 @@ str_lower_case_match(OnigEncoding enc, int case_fold_flag,
     lowlen = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &p, end, lowbuf);
     q = lowbuf;
     while (lowlen > 0) {
+      if (t >= tend)    return 0;
       if (*t++ != *q++) return 0;
       lowlen--;
     }