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>
1 parent 5de7d31 commit 9271182f3b32d41a83ca802a63580c0c4fef9b9e
@Jan Remmet Jan Remmet authored on 23 May 2019
Sascha Hauer committed on 23 May 2019
Showing 1 changed file
View
common/state/backend_bucket_direct.c