diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_net.c | 7 | ||||
-rw-r--r-- | common/cmd_nvedit.c | 2 | ||||
-rw-r--r-- | common/cmd_pxe.c | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/common/cmd_net.c b/common/cmd_net.c index f89a24bfd4..89519faad3 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -221,8 +221,11 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, #ifdef CONFIG_CMD_TFTPPUT case 4: - save_addr = strict_strtoul(argv[1], NULL, 16); - save_size = strict_strtoul(argv[2], NULL, 16); + if (strict_strtoul(argv[1], 16, &save_addr) < 0 || + strict_strtoul(argv[2], 16, &save_size) < 0) { + printf("Invalid address/size\n"); + return cmd_usage(cmdtp); + } copy_filename(BootFile, argv[3], sizeof(BootFile)); break; #endif diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index baaa513f6b..63afc82fe2 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -868,7 +868,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, printf("## Warning: Input data exceeds %d bytes" " - truncated\n", MAX_ENV_SIZE); } - ++size; + size += 2; printf("## Info: input data size = %zu = 0x%zX\n", size, size); } diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 9426f5b05b..7c0cb66668 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -918,7 +918,7 @@ static int parse_menu(char **c, struct pxe_menu *cfg, char *b, int nest_level) { struct token t; char *s = *c; - int err; + int err = 0; get_token(c, &t, L_KEYWORD); |