Commit
bd3b7478d1e17b4d487d276f5cc0e4f4ef9fc4b7
Exists in
smarc_8mq_lf_v2020.04
and in
12 other branches
8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0
efi_loader: endless loop in add_strings_package()
Avoid an endless loop in add_strings_package().
Suggested-by: Takahiro Akashi <takahiro.akashi@linaro.org>
Reported-by: Coverity (CID 185833)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Showing
1 changed file
with
2 additions
and
3 deletions
Side-by-side Diff
... |
... |
@@ -227,9 +227,8 @@ |
227
|
227 |
error: |
228
|
228 |
if (stbl) { |
229
|
229 |
free(stbl->language); |
230
|
|
- if (idx > 0) |
231
|
|
- while (--idx >= 0) |
232
|
|
- free(stbl->strings[idx].string); |
|
230 |
+ while (idx > 0) |
|
231 |
+ free(stbl->strings[--idx].string); |
233
|
232 |
free(stbl->strings); |
234
|
233 |
} |
235
|
234 |
free(stbl); |