libjade: accept non-literal tags in mocked ESP_LOG macros
What changed, and why it matters
This is a small build-fix change. The project has mock versions of ESP logging macros used when building on a regular computer (host build). Previously these macros treated the log tag as a string literal, which broke compilation when a module passed a variable tag. The patch changes the macros to print the tag via %s instead. There is no security issue here.
No security action needed. Treat as normal build fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies libjade/include/esp_log.h mock macros (ESP_LOGD/I/W/E). Previously they concatenated the tag argument f into the format string as a literal (“DEBUG:” f “:” fmt). This failed when f was a static const char* variable such as k_quirc’s TAG. The fix passes f as a %s argument so non-literal tags work, restoring the host build. No functional behavior changes on device; no security boundary is crossed.
Changed components
libjade/include/esp_log.hInspect captured patch +5 / −4
diff --git a/libjade/include/esp_log.h b/libjade/include/esp_log.h
index f632269..01b25fb 100644
--- a/libjade/include/esp_log.h
+++ b/libjade/include/esp_log.h
@@ -21,22 +21,22 @@ extern esp_log_level_t _libjade_log_level;
#define ESP_LOGD(f, fmt, ...) \
do { \
if (_libjade_log_level <= ESP_LOG_DEBUG) \
- fprintf(stderr, "DEBUG:" f ":" fmt "\n", __VA_ARGS__); \
+ fprintf(stderr, "DEBUG:%s:" fmt "\n", f, __VA_ARGS__); \
} while (0)
#define ESP_LOGI(f, fmt, ...) \
do { \
if (_libjade_log_level <= ESP_LOG_INFO) \
- fprintf(stderr, "INFO:" f ":" fmt "\n", __VA_ARGS__); \
+ fprintf(stderr, "INFO:%s:" fmt "\n", f, __VA_ARGS__); \
} while (0)
#define ESP_LOGW(f, fmt, ...) \
do { \
if (_libjade_log_level <= ESP_LOG_WARN) \
- fprintf(stderr, "WARN:" f ":" fmt "\n", __VA_ARGS__); \
+ fprintf(stderr, "WARN:%s:" fmt "\n", f, __VA_ARGS__); \
} while (0)
#define ESP_LOGE(f, fmt, ...) \
do { \
if (_libjade_log_level <= ESP_LOG_ERROR) \
- fprintf(stderr, "ERROR:" f ":" fmt "\n", __VA_ARGS__); \
+ fprintf(stderr, "ERROR:%s:" fmt "\n", f, __VA_ARGS__); \
} while (0)
#ifndef CONFIG_LOG_DEFAULT_LEVEL_NONE
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.