summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-11-28 14:38:09 +0000
committerAidan MacDonald <amachronic@protonmail.com>2021-11-28 15:46:06 +0000
commit1ad60c33441619f2f3e9111d762b73264db1d44c (patch)
treed0d03c1625d270d1cc35045d96c515b65497a097
parentc086a3386f844e9e62df8fde22d27459dd66d541 (diff)
downloadrockbox-1ad60c33441619f2f3e9111d762b73264db1d44c.tar.gz
rockbox-1ad60c33441619f2f3e9111d762b73264db1d44c.zip
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
-rw-r--r--lib/x1000-installer/src/xf_flashmap.c4
1 files changed, 1 insertions, 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)
136 136
137 if(int_val > UINT32_MAX/16) 137 if(int_val > UINT32_MAX/16)
138 return XF_E_INT_OVERFLOW; 138 return XF_E_INT_OVERFLOW;
139 int_val *= 16;
140 139
141 if(int_val > UINT32_MAX - digit_val) 140 int_val *= 16;
142 return XF_E_INT_OVERFLOW;
143 int_val |= digit_val; 141 int_val |= digit_val;
144 } 142 }
145 } 143 }