[前][次][番号順一覧][スレッド一覧]

ruby-changes:68453

From: Nobuyoshi <ko1@a...>
Date: Thu, 14 Oct 2021 18:43:52 +0900 (JST)
Subject: [ruby-changes:68453] 1d6a490c2c (master): Cast up to get rid of the potential overflow posibility

https://git.ruby-lang.org/ruby.git/commit/?id=1d6a490c2c

From 1d6a490c2c67d4796c52335bdb28038960c29d9d Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 14 Oct 2021 14:27:30 +0900
Subject: 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) https://github.com/ruby/ruby/blob/trunk/regcomp.c#L5034
 
 	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,
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]