From: K.Kosako Date: Tue, 13 Aug 2019 04:37:30 +0000 (+0900) Subject: fix heap-buffer-overflow X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3e402928b6eb3327f8f7d59a9edfa622fec557b;p=onig fix heap-buffer-overflow --- diff --git a/src/regexec.c b/src/regexec.c index 0753b07..634ee42 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -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--; }