]> git.dujemihanovic.xyz Git - u-boot.git/commit
env: Crash in 'env import' when using checksum and a specific size
authorPedro Aguilar <pedro.aguilar@vimar.com>
Mon, 31 Aug 2020 09:01:41 +0000 (11:01 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 11 Sep 2020 21:13:56 +0000 (17:13 -0400)
commit142775a52bc97d5273922970b8a9cc9f95091359
treea8812bfe240568d9831a077d99d345f43d294d4c
parent21d3946840fd62dc09e93986743915bcbac100b7
env: Crash in 'env import' when using checksum and a specific size

This patch adds a sanity check that avoids 'size' to overflow and crash when
importing an environment that contains a checksum. Example with the wrong size
that causes the crash:

=> env import -c 0x4100000 3 v1

This assumes that v1 has already been successfully exported with
'env export -c -s 0x100 0x4100000 v1'

Signed-off-by: Pedro Aguilar <pedro.aguilar@vimar.com>
cmd/nvedit.c