From: Pali Rohár Date: Wed, 12 Jan 2022 17:20:51 +0000 (+0100) Subject: tools: kwbimage: Do not cast const pointers to non-const pointers X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=1a0e52f50a2085c46bf3bc5116f820a3cb655a2c;p=u-boot.git tools: kwbimage: Do not cast const pointers to non-const pointers Avoid casting const to non-const. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún Reviewed-by: Stefan Roese --- diff --git a/tools/kwbimage.h b/tools/kwbimage.h index 8d37357e5a..c000cba4b8 100644 --- a/tools/kwbimage.h +++ b/tools/kwbimage.h @@ -235,11 +235,11 @@ static inline int opt_hdr_v1_valid_size(const struct opt_hdr_v1 *ohdr, { uint32_t ohdr_size; - if ((void *)(ohdr + 1) > mhdr_end) + if ((const void *)(ohdr + 1) > mhdr_end) return 0; ohdr_size = opt_hdr_v1_size(ohdr); - if (ohdr_size < 8 || (void *)((uint8_t *)ohdr + ohdr_size) > mhdr_end) + if (ohdr_size < 8 || (const void *)((const uint8_t *)ohdr + ohdr_size) > mhdr_end) return 0; return 1;