File: CVE-2025-7207.patch

package info (click to toggle)
mruby 3.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,584 kB
  • sloc: ansic: 51,933; ruby: 29,510; yacc: 7,077; cpp: 517; makefile: 51; sh: 42
file content (28 lines) | stat: -rw-r--r-- 873 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 1fdd96104180cc0fb5d3cb086b05ab6458911bb9 Mon Sep 17 00:00:00 2001
From: "Yukihiro \"Matz\" Matsumoto" <matz@ruby.or.jp>
Date: Mon, 7 Apr 2025 11:35:19 +0900
Subject: [PATCH] mruby-compiler (scope_new): need to initialize nregs; fix
 #6509

`nregs` should not be smaller than `nlocals`.

---
 mrbgems/mruby-compiler/core/codegen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index be0bf875a..9deaa7fec 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -4012,7 +4012,7 @@ scope_new(mrb_state *mrb, codegen_scope *prev, node *nlv)
 
   s->lv = nlv;
   s->sp += node_len(nlv)+1;        /* add self */
-  s->nlocals = s->sp;
+  s->nlocals = s->nregs = s->sp;
   if (nlv) {
     mrb_sym *lv;
     node *n = nlv;
-- 
2.50.1