This ports the following barebox commit:
| commit 9271182
| Author: Jan Remmet <j.remmet@phytec.de>
| Date: Thu May 23 09:49:00 2019 +0200
|
| common: state: check length
|
| if written_length is read from a partial written bucket it may be to
| big and xmalloc will panic barebox.
|
| Check if the value is sane. Make read_len unsigned to avoid negative
| values.
|
| Signed-off-by: Jan Remmet <j.remmet@phytec.de>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>