Skip to contentSkip to conversation

cmd_nvedit: Make 'env import -c' require size parameter

PATCH In review Tom Rini 1 participant 2 messages Mar 4, 2014 – Mar 7, 2014

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 cmd_nvedit: Make 'env import -c' require size parameter

When importing a checksummed area we need to be told how big the area in question is so that we know that will match the size of the area which the checksum is generated against.

---
 common/cmd_nvedit.c |    3 +++
 1 file changed, 3 insertions(+)
common/cmd_nvedit.c +3 -0
index 5bcc324..c53601c 100644
@@ -1008,6 +1008,9 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
 
 	if (argc == 2) {
 		size = simple_strtoul(argv[1], NULL, 16);
+	} else if (argc == 1 && chk) {
+		puts("## Error: external checksum format must pass size\n");
+		return CMD_RET_FAILURE;
 	} else {
 		char *s = addr;
 
Signature · 1 line
1.7.9.5
author
#1 lore raw
Quoted 6 lines · Tom Rini

When importing a checksummed area we need to be told how big the area in question is so that we know that will match the size of the area which the checksum is generated against.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140307/3bb6e572/attachment.pgp>