diff options
| author | Tom Rini <[email protected]> | 2020-09-14 15:39:27 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2020-09-14 15:39:46 -0400 |
| commit | 00e5fda0063eaa20e9c3f6844ac88c64eb875f23 (patch) | |
| tree | 20397adfefbe204c2b348e271c056620f4bcadcc /cmd | |
| parent | 3dd52dd69e6507624c7bb98aa1dbd5034221afcd (diff) | |
| parent | 185440ffc46f310b0f300c10804ba3cb0a7bf15a (diff) | |
Merge branch '2020-09-12-assorted-bugfixes'
- A large assortment of minor fixes
- Documentation improvements
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/nvedit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c index d188c6aa6b7..9f145dd2846 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)); |
