diff options
| author | Steve McIntyre <steve@einval.com> | 2024-02-17 17:35:37 +0000 |
|---|---|---|
| committer | Steve McIntyre <steve@einval.com> | 2024-05-03 14:36:51 +0100 |
| commit | f898e219b4b06cf2bb7af18b5cc7a00754d3d274 (patch) | |
| tree | c535b3ff1b13388dbaa7072c7f5ec78f5d73ee53 /shim.h | |
| parent | 3cf4042d82ef314f19e9f7bd4f86c4b59efd8233 (diff) | |
| download | efi-boot-shim-f898e219b4b06cf2bb7af18b5cc7a00754d3d274.tar.gz efi-boot-shim-f898e219b4b06cf2bb7af18b5cc7a00754d3d274.zip | |
New upstream version 15.8
Diffstat (limited to 'shim.h')
| -rw-r--r-- | shim.h | 29 |
1 files changed, 23 insertions, 6 deletions
@@ -180,6 +180,7 @@ #include "include/replacements.h" #include "include/sbat.h" #include "include/sbat_var_defs.h" +#include "include/ssp.h" #if defined(OVERRIDE_SECURITY_POLICY) #include "include/security_policy.h" #endif @@ -281,18 +282,32 @@ verify_buffer (char *data, int datasize, #ifndef SHIM_UNIT_TEST #define perror_(file, line, func, fmt, ...) ({ \ UINTN __perror_ret = 0; \ + _Static_assert((fmt) != NULL, \ + "format specifier cannot be NULL"); \ if (!in_protocol) \ __perror_ret = console_print((fmt), ##__VA_ARGS__); \ LogError_(file, line, func, fmt, ##__VA_ARGS__); \ __perror_ret; \ }) -#define perror(fmt, ...) \ - perror_(__FILE__, __LINE__ - 1, __func__, fmt, ##__VA_ARGS__) -#define LogError(fmt, ...) \ - LogError_(__FILE__, __LINE__ - 1, __func__, fmt, ##__VA_ARGS__) +#define perror(fmt, ...) ({ \ + _Static_assert((fmt) != NULL, \ + "format specifier cannot be NULL"); \ + perror_(__FILE__, __LINE__ - 1, __func__, fmt, ##__VA_ARGS__); \ + }) +#define LogError(fmt, ...) ({ \ + _Static_assert((fmt) != NULL, \ + "format specifier cannot be NULL"); \ + LogError_(__FILE__, __LINE__ - 1, __func__, fmt, ##__VA_ARGS__);\ + }) #else -#define perror(fmt, ...) -#define LogError(fmt, ...) +#define perror(fmt, ...) ({ \ + _Static_assert((fmt) != NULL, \ + "format specifier cannot be NULL"); \ + }) +#define LogError(fmt, ...) ({ \ + _Static_assert((fmt) != NULL, \ + "format specifier cannot be NULL"); \ + }) #endif #ifdef ENABLE_SHIM_DEVEL @@ -305,6 +320,8 @@ verify_buffer (char *data, int datasize, #define DEBUG_VAR_NAME L"SHIM_DEBUG" #endif +#define SHIM_RETAIN_PROTOCOL_VAR_NAME L"ShimRetainProtocol" + char *translate_slashes(char *out, const char *str); #endif /* SHIM_H_ */ |
