From 3da69af83cc73098ff7bab5e09cdbbf747f0f69a Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sat, 10 Jan 2026 07:11:51 +0100 Subject: [PATCH] font: logf: fix pointer in buflibmove_callback Buffer contents are only moved after the callback returns, so we need to log the path before it has been updated to prevent reading garbage. Change-Id: I187fbd56484249c456155ffcbdde9e44e766dde8 --- firmware/font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/font.c b/firmware/font.c index 0f11ea5a0a..689445692b 100644 --- a/firmware/font.c +++ b/firmware/font.c @@ -121,6 +121,7 @@ static int buflibmove_callback(int handle, void* current, void* new) struct buflib_alloc_data *alloc = (struct buflib_alloc_data*)current; ptrdiff_t diff = new - current; + logf("%s %s", __func__, alloc->path); #define UPDATE(x) if (x) { x = PTR_ADD(x, diff); } UPDATE(alloc->font.bits); @@ -134,7 +135,6 @@ static int buflibmove_callback(int handle, void* current, void* new) UPDATE(alloc->font.cache._index); UPDATE(alloc->font.cache._lru._base); - logf("%s %s", __func__, alloc->path); return BUFLIB_CB_OK; } static void lock_font_handle(int handle, bool lock)