summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-14 14:27:30 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-14 18:43:32 +0900
commit1d6a490c2c67d4796c52335bdb28038960c29d9d (patch)
tree18838f1f76237ad5e7b02c684ceaaaa540eb42cd /regcomp.c
parent1220556f33e21b4ba76e982f1a3b18cb47403bfb (diff)
Cast up to get rid of the potential overflow posibility
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4968
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 44ee0b2e51..d51163103e 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5034,7 +5034,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
if (NSTRING_IS_DONT_GET_OPT_INFO(node)) {
int n = onigenc_strlen(env->enc, sn->s, sn->end);
- max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * n;
+ max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * (OnigDistance)n;
}
else {
concat_opt_exact_info_str(&opt->exb, sn->s, sn->end,