logger: Skip %s from formatting string

Passing %s with random address leads to logger crash.
It's especially important right now, after changing
print formatter for UUID from %s to %pU. It's why
DBG_ABI patch number has been updated.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit is contained in:
Karol Trzcinski 2020-09-25 15:21:52 +02:00 committed by Liam Girdwood
parent 12f2d9b2c8
commit 5b0b1a3db5
2 changed files with 8 additions and 1 deletions

View File

@ -20,7 +20,7 @@
#define SOF_ABI_DBG_MAJOR 5
#define SOF_ABI_DBG_MINOR 2
#define SOF_ABI_DBG_PATCH 0
#define SOF_ABI_DBG_PATCH 1
#define SOF_ABI_DBG_VERSION SOF_ABI_VER(SOF_ABI_DBG_MAJOR, \
SOF_ABI_DBG_MINOR, \

View File

@ -200,6 +200,13 @@ static void process_params(struct proc_ldc_entry *pe,
if (p[1] == '%') {
/* Skip "%%" */
p += 2;
} else if (p[1] == 's') {
/* check for string printing, because it leads to logger crash */
log_err("String printing is not supported\n");
pe->params[i] = (uintptr_t)asprintf("<String @ 0x%08x>", e->params[i]);
pe->subst_mask |= 1 << i;
++i;
p += 2;
} else if (p + 2 >= t_end && p[1] == 'p' && p[2] == 'U') {
/* substitute UUID entry address with formatted string pointer from heap */
pe->params[i] = (uintptr_t)asprintf_uuid(p, e->params[i], use_colors,