summaryrefslogtreecommitdiff
path: root/cmd/nvedit.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-09-14 15:39:27 -0400
committerTom Rini <trini@konsulko.com>2020-09-14 15:39:46 -0400
commit00e5fda0063eaa20e9c3f6844ac88c64eb875f23 (patch)
tree20397adfefbe204c2b348e271c056620f4bcadcc /cmd/nvedit.c
parent3dd52dd69e6507624c7bb98aa1dbd5034221afcd (diff)
parent185440ffc46f310b0f300c10804ba3cb0a7bf15a (diff)
Merge branch '2020-09-12-assorted-bugfixes'
- A large assortment of minor fixes - Documentation improvements
Diffstat (limited to 'cmd/nvedit.c')
-rw-r--r--cmd/nvedit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index d188c6aa6b..9f145dd284 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -1171,6 +1171,11 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag,
uint32_t crc;
env_t *ep = (env_t *)ptr;
+ if (size <= offsetof(env_t, data)) {
+ printf("## Error: Invalid size 0x%zX\n", size);
+ return 1;
+ }
+
size -= offsetof(env_t, data);
memcpy(&crc, &ep->crc, sizeof(crc));