Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
97be7b8b
Unverified
Commit
97be7b8b
authored
Feb 06, 2021
by
longpanda
Committed by
GitHub
Feb 06, 2021
Browse files
fix integer overflow issue for i386-pc
parent
3dd3b7d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
+5
-5
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
View file @
97be7b8b
...
@@ -541,8 +541,8 @@ static grub_err_t ventoy_cmd_incr(grub_extcmd_context_t ctxt, int argc, char **a
...
@@ -541,8 +541,8 @@ static grub_err_t ventoy_cmd_incr(grub_extcmd_context_t ctxt, int argc, char **a
static
grub_err_t
ventoy_cmd_mod
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
static
grub_err_t
ventoy_cmd_mod
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
{
{
long
value1
=
0
;
ulong
long
value1
=
0
;
long
value2
=
0
;
ulong
long
value2
=
0
;
char
buf
[
32
];
char
buf
[
32
];
if
(
argc
!=
3
)
if
(
argc
!=
3
)
...
@@ -550,10 +550,10 @@ static grub_err_t ventoy_cmd_mod(grub_extcmd_context_t ctxt, int argc, char **ar
...
@@ -550,10 +550,10 @@ static grub_err_t ventoy_cmd_mod(grub_extcmd_context_t ctxt, int argc, char **ar
return
grub_error
(
GRUB_ERR_BAD_ARGUMENT
,
"Usage: %s {Int} {Int} {Variable}"
,
cmd_raw_name
);
return
grub_error
(
GRUB_ERR_BAD_ARGUMENT
,
"Usage: %s {Int} {Int} {Variable}"
,
cmd_raw_name
);
}
}
value1
=
grub_strtol
(
args
[
0
],
NULL
,
10
);
value1
=
grub_strto
ul
l
(
args
[
0
],
NULL
,
10
);
value2
=
grub_strtol
(
args
[
1
],
NULL
,
10
);
value2
=
grub_strto
ul
l
(
args
[
1
],
NULL
,
10
);
grub_snprintf
(
buf
,
sizeof
(
buf
),
"%l
d
"
,
(
value1
%
value2
));
grub_snprintf
(
buf
,
sizeof
(
buf
),
"%l
lu
"
,
(
value1
%
value2
));
grub_env_set
(
args
[
2
],
buf
);
grub_env_set
(
args
[
2
],
buf
);
VENTOY_CMD_RETURN
(
GRUB_ERR_NONE
);
VENTOY_CMD_RETURN
(
GRUB_ERR_NONE
);
...
...
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