From 6436c6e749ab04fbd5d97804a6a1c3b3122b326d Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 10 Feb 2017 20:10:14 -0500 Subject: Fix tagtree from blowing up when its buffer moves I noticed that after booting with the external storage removed, playing from tagtree, inserting the card, forcing dircache to reallocate from the debug screen, and trying to reenter tagtree, it would data abort because the dircache reallaction to a larger size caused the tagtree buffer to move. Adjustment to at least one pointer (csi) was missed. Since it's non-trivial there to determine when things should be NULL and when they shouldn't, add check for menu too before moving it. As for the rest, who knows. Change-Id: Iea6538a2091b4b47083f39296555efc47edf8ba8 --- apps/tagtree.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/tagtree.c b/apps/tagtree.c index b3b94a489e..ba27c84f6a 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -201,7 +201,12 @@ static int move_callback(int handle, void* current, void* new) if (lock_count > 0) return BUFLIB_CB_CANNOT_MOVE; - UPDATE(menu, diff); + if (menu) + UPDATE(menu, diff); + + if (csi) + UPDATE(csi, diff); + /* loop over menus */ for(int i = 0; i < menu_count; i++) { -- cgit v1.2.3