From 1d6a490c2c67d4796c52335bdb28038960c29d9d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 14 Oct 2021 14:27:30 +0900 Subject: [PATCH] Cast up to get rid of the potential overflow posibility --- regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,