Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
c779413d
Unverified
Commit
c779413d
authored
4 years ago
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix out of bound access in `parse.y`.
parent
9cebddf9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+1
-1
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
+1
-1
src/load.c
src/load.c
+1
-1
No files found.
mrbgems/mruby-compiler/core/parse.y
View file @
c779413d
...
@@ -284,7 +284,7 @@ local_var_p(parser_state *p, mrb_sym sym)
...
@@ -284,7 +284,7 @@ local_var_p(parser_state *p, mrb_sym sym)
int i;
int i;
if (!v) break;
if (!v) break;
for (i=0; i < ir->nlocals; i++) {
for (i=0; i
+1
< ir->nlocals; i++) {
if (v[i] == sym) return TRUE;
if (v[i] == sym) return TRUE;
}
}
if (MRB_PROC_SCOPE_P(u)) break;
if (MRB_PROC_SCOPE_P(u)) break;
...
...
This diff is collapsed.
Click to expand it.
mrbgems/mruby-compiler/core/y.tab.c
View file @
c779413d
...
@@ -347,7 +347,7 @@ local_var_p(parser_state *p, mrb_sym sym)
...
@@ -347,7 +347,7 @@ local_var_p(parser_state *p, mrb_sym sym)
int i;
int i;
if (!v) break;
if (!v) break;
for (i=0; i < ir->nlocals; i++) {
for (i=0; i
+1
< ir->nlocals; i++) {
if (v[i] == sym) return TRUE;
if (v[i] == sym) return TRUE;
}
}
if (MRB_PROC_SCOPE_P(u)) break;
if (MRB_PROC_SCOPE_P(u)) break;
...
...
This diff is collapsed.
Click to expand it.
src/load.c
View file @
c779413d
...
@@ -434,7 +434,7 @@ read_lv_record(mrb_state *mrb, const uint8_t *start, mrb_irep *irep, size_t *rec
...
@@ -434,7 +434,7 @@ read_lv_record(mrb_state *mrb, const uint8_t *start, mrb_irep *irep, size_t *rec
irep
->
lv
=
lv
=
(
mrb_sym
*
)
mrb_malloc
(
mrb
,
sizeof
(
mrb_sym
)
*
(
irep
->
nlocals
-
1
));
irep
->
lv
=
lv
=
(
mrb_sym
*
)
mrb_malloc
(
mrb
,
sizeof
(
mrb_sym
)
*
(
irep
->
nlocals
-
1
));
for
(
i
=
0
;
i
+
1
<
irep
->
nlocals
;
++
i
)
{
for
(
i
=
0
;
i
+
1
<
irep
->
nlocals
;
++
i
)
{
uint16_t
const
sym_idx
=
bin_to_uint16
(
bin
);
uint16_t
const
sym_idx
=
bin_to_uint16
(
bin
);
bin
+=
sizeof
(
uint16_t
);
bin
+=
sizeof
(
uint16_t
);
if
(
sym_idx
==
RITE_LV_NULL_MARK
)
{
if
(
sym_idx
==
RITE_LV_NULL_MARK
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment