From 4f683f01d4d3cbdf83fd01a59ed730cb9f3f760b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 26 Nov 2021 17:26:42 -0800 Subject: [PATCH] Fixed potentially truncated entry in stack trace --- src/test/SDL_test_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/SDL_test_memory.c b/src/test/SDL_test_memory.c index e49bd60ab..b7f803051 100644 --- a/src/test/SDL_test_memory.c +++ b/src/test/SDL_test_memory.c @@ -104,13 +104,13 @@ static void SDL_TrackAllocation(void *mem, size_t size) stack_index = 0; while (unw_step(&cursor) > 0) { unw_word_t offset, pc; - char sym[256]; + char sym[236]; unw_get_reg(&cursor, UNW_REG_IP, &pc); entry->stack[stack_index] = pc; if (unw_get_proc_name(&cursor, sym, sizeof(sym), &offset) == 0) { - snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, (unsigned long long)offset); + SDL_snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, (unsigned long long)offset); } ++stack_index;