From f2ec4cf3bca6f6fc5cc5d5f34544f7edf3835b3c Mon Sep 17 00:00:00 2001 From: Hubert Feurstein Date: Fri, 4 Sep 2020 12:10:40 +0200 Subject: imd: imd_calculate_crc32: initialize imd_crc to NULL This fixes a dereference of an uninitialized pointer when imd-crc-token is not found. Signed-off-by: Hubert Feurstein Signed-off-by: Sascha Hauer --- common/imd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/imd.c b/common/imd.c index 96496514a5..0644e6d3bf 100644 --- a/common/imd.c +++ b/common/imd.c @@ -312,6 +312,7 @@ static int imd_calculate_crc32(void *input, const struct imd_header *imd_start, const struct imd_header *imd; int length; int end_ofs = (char *)imd_start - (char *)input + sizeof(char) * 8; + *imd_crc = NULL; /* search the checksum imd token */ imd_for_each(imd_start, imd) { -- cgit v1.2.3