Fixed potentially truncated entry in stack trace

main
Sam Lantinga 2021-11-26 17:26:42 -08:00
parent 5f1558ffe3
commit 4f683f01d4
1 changed files with 2 additions and 2 deletions

View File

@ -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;