From: Heinrich Schuchardt Date: Tue, 19 Mar 2019 11:30:27 +0000 (+0100) Subject: efi_loader: endless loop in add_strings_package() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=bd3b7478d1e17b4d487d276f5cc0e4f4ef9fc4b7;p=u-boot.git efi_loader: endless loop in add_strings_package() Avoid an endless loop in add_strings_package(). Suggested-by: Takahiro Akashi Reported-by: Coverity (CID 185833) Signed-off-by: Heinrich Schuchardt --- diff --git a/lib/efi_loader/efi_hii.c b/lib/efi_loader/efi_hii.c index 3a966fa4df..61b71dec62 100644 --- a/lib/efi_loader/efi_hii.c +++ b/lib/efi_loader/efi_hii.c @@ -227,9 +227,8 @@ out: error: if (stbl) { free(stbl->language); - if (idx > 0) - while (--idx >= 0) - free(stbl->strings[idx].string); + while (idx > 0) + free(stbl->strings[--idx].string); free(stbl->strings); } free(stbl);