summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobbie Harwood <rharwood@redhat.com>2022-08-23 12:07:16 -0400
committerPeter Jones <pjones@redhat.com>2022-09-01 15:38:02 -0400
commit14d63398298c8de23036a4cf61594108b7345863 (patch)
treed5072dba3713456d222f23f3ab3fa82280fb3f35 /include
parent4fd484e4c29364b4fdf4d043556fa0a210c5fdfc (diff)
downloadefi-boot-shim-14d63398298c8de23036a4cf61594108b7345863.tar.gz
efi-boot-shim-14d63398298c8de23036a4cf61594108b7345863.zip
Discard load-options that start with a NUL
In 6c8d08c0af4768c715b79c8ec25141d56e34f8b4 ("shim: Ignore UEFI LoadOptions that are just NUL characters."), a check was added to discard load options that are entirely NUL. We now see some firmwares that start LoadOptions with a NUL, and then follow it with garbage (path to directory containing loaders). Widen the check to just discard anything that starts with a NUL. Resolves: #490 Related: #95 See-also: https://bugzilla.redhat.com/show_bug.cgi?id=2113005 Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/ucs2.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/include/ucs2.h b/include/ucs2.h
index ee038ce7..87eab32f 100644
--- a/include/ucs2.h
+++ b/include/ucs2.h
@@ -63,22 +63,4 @@ StrCSpn(const CHAR16 *s, const CHAR16 *reject)
return ret;
}
-/*
- * Test if an entire buffer is nothing but NUL characters. This
- * implementation "gracefully" ignores the difference between the
- * UTF-8/ASCII 1-byte NUL and the UCS-2 2-byte NUL.
- */
-static inline bool
-__attribute__((__unused__))
-is_all_nuls(UINT8 *data, UINTN data_size)
-{
- UINTN i;
-
- for (i = 0; i < data_size; i++) {
- if (data[i] != 0)
- return false;
- }
- return true;
-}
-
#endif /* SHIM_UCS2_H */