fix integer overflow issue for i386-pc

This commit is contained in:
longpanda 2021-02-06 15:41:43 +08:00 committed by GitHub
parent 97be7b8bfb
commit 2185556dfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);