efi-loader: make efi_loader_get_entries() handling missing NUL termination gracefully
authorLennart Poettering <lennart@poettering.net>
Mon, 12 Feb 2024 16:23:59 +0000 (17:23 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 14 Feb 2024 14:35:52 +0000 (15:35 +0100)
commit2cda44c23eb54cebf60f90aaeda82d95ec204152
tree930d131eb6d8200d2012ab54a2eaee7810a15c06
parent37c6c2035e31af7fc8b1042294086e8cdaf44604
efi-loader: make efi_loader_get_entries() handling missing NUL termination gracefully

Our function so far assumed that the LoaderEntries's last string is or
is not NUL terminated. But if it was, then we'd debug log about this,
claiming there was an invalid id. sd-boot actually ends the list in a
properly NUL-terminated string, hence we should just accept that. Handle
that case gracefully, and add comments explaining why we have two ways
why we exit the loop.

This is cosmetic only, just suppresses a misleading debug log message.
src/shared/efi-loader.c