Commit bd3b7478d1e17b4d487d276f5cc0e4f4ef9fc4b7

Authored by Heinrich Schuchardt
1 parent 306b16718e

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

lib/efi_loader/efi_hii.c
... ... @@ -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);