From 1ad60c33441619f2f3e9111d762b73264db1d44c Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 28 Nov 2021 14:38:09 +0000 Subject: [PATCH] x1000-installer: remove redundant overflow check This overflow is impossible to trigger due to the simple relationship between binary and hexadecimal numbers. Change-Id: Ie8243129967abb935a77152a808765318052c979 --- lib/x1000-installer/src/xf_flashmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/x1000-installer/src/xf_flashmap.c b/lib/x1000-installer/src/xf_flashmap.c index dc0a26a019..972bf320ad 100644 --- a/lib/x1000-installer/src/xf_flashmap.c +++ b/lib/x1000-installer/src/xf_flashmap.c @@ -136,10 +136,8 @@ int xf_map_parseline(const char* line, struct xf_map* map) if(int_val > UINT32_MAX/16) return XF_E_INT_OVERFLOW; - int_val *= 16; - if(int_val > UINT32_MAX - digit_val) - return XF_E_INT_OVERFLOW; + int_val *= 16; int_val |= digit_val; } }