Skip to content

Commit

Permalink
fix integer overflow issue for i386-pc
Browse files Browse the repository at this point in the history
  • Loading branch information
ventoy authored Feb 6, 2021
1 parent 97be7b8 commit 2185556
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ static grub_err_t ventoy_cmd_mod(grub_extcmd_context_t ctxt, int argc, char **ar
value1 = grub_strtoull(args[0], NULL, 10);
value2 = grub_strtoull(args[1], NULL, 10);

grub_snprintf(buf, sizeof(buf), "%llu", (value1 % value2));
grub_snprintf(buf, sizeof(buf), "%llu", (value1 & (value2 - 1)));
grub_env_set(args[2], buf);

VENTOY_CMD_RETURN(GRUB_ERR_NONE);
Expand Down

0 comments on commit 2185556

Please sign in to comment.