* [U-Boot] [PATCH] common/cmd_nvedit.c: Fix size calculation in do_env_import()
@ 2011-12-17 9:33 Horst Kronstorfer
2011-12-17 20:05 ` Wolfgang Denk
2011-12-19 9:19 ` Wolfgang Denk
0 siblings, 2 replies; 4+ messages in thread
From: Horst Kronstorfer @ 2011-12-17 9:33 UTC (permalink / raw)
To: u-boot
do_env_import() missed the final '\0' terminator when calculating the
size of an environment data block. This led to an erroneous 'bad CRC,
import failed' message for a checksum protected environment (-c.)
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
---
common/cmd_nvedit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index baaa513..63afc82 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);
}
--
1.7.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [U-Boot] [PATCH] common/cmd_nvedit.c: Fix size calculation in do_env_import()
2011-12-17 9:33 [U-Boot] [PATCH] common/cmd_nvedit.c: Fix size calculation in do_env_import() Horst Kronstorfer
@ 2011-12-17 20:05 ` Wolfgang Denk
[not found] ` <024FE3275EF7814D9B07390F28C0832C63A20CBC@vie196nt.frequentis.frq>
2011-12-19 9:19 ` Wolfgang Denk
1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2011-12-17 20:05 UTC (permalink / raw)
To: u-boot
Dear Horst Kronstorfer,
In message <1324114390-27290-1-git-send-email-hkronsto@frequentis.com> you wrote:
> do_env_import() missed the final '\0' terminator when calculating the
> size of an environment data block. This led to an erroneous 'bad CRC,
> import failed' message for a checksum protected environment (-c.)
Can you please describe a test case that shows this bug?
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
God made the integers; all else is the work of Man. - Kronecker
^ permalink raw reply [flat|nested] 4+ messages in thread* [U-Boot] [PATCH] common/cmd_nvedit.c: Fix size calculation in do_env_import()
2011-12-17 9:33 [U-Boot] [PATCH] common/cmd_nvedit.c: Fix size calculation in do_env_import() Horst Kronstorfer
2011-12-17 20:05 ` Wolfgang Denk
@ 2011-12-19 9:19 ` Wolfgang Denk
1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2011-12-19 9:19 UTC (permalink / raw)
To: u-boot
Dear Horst Kronstorfer,
In message <1324114390-27290-1-git-send-email-hkronsto@frequentis.com> you wrote:
> do_env_import() missed the final '\0' terminator when calculating the
> size of an environment data block. This led to an erroneous 'bad CRC,
> import failed' message for a checksum protected environment (-c.)
>
> Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
> ---
> common/cmd_nvedit.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You don't have to stay up nights to succeed; you have to stay awake
days.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-19 9:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-17 9:33 [U-Boot] [PATCH] common/cmd_nvedit.c: Fix size calculation in do_env_import() Horst Kronstorfer
2011-12-17 20:05 ` Wolfgang Denk
[not found] ` <024FE3275EF7814D9B07390F28C0832C63A20CBC@vie196nt.frequentis.frq>
2011-12-19 9:17 ` Wolfgang Denk
2011-12-19 9:19 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox