[PATCH] imd: imd_calculate_crc32: initialize imd_crc to NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hubert Feurstein <h.feurstein@xxxxxxxxx>

This fixes a NULL pointer dereference in the caller when imd-crc-token is
not found.

Signed-off-by: Hubert Feurstein <h.feurstein@xxxxxxxxx>
---
 common/imd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/imd.c b/common/imd.c
index 96496514a..0644e6d3b 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) {
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux