Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#12008 - Empty menus lead to NULL pointer access

Attached to Project: Rockbox
Opened by Thomas Jarosch (thomasjfox) - Sunday, 13 March 2011, 10:59 GMT+2
Task Type Bugs
Category User Interface
Status New
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Private No

Details

Hello,

empty menu items crash rockbox due to NULL pointer access.
Easily reproducable with the "LCD settings" in RaaA / SDL app build.

The resulting valgrind trace looks like this:
==22619== Invalid read of size 4
==22619== at 0x407FDA: do_menu (menu.c:555)
==22619== by 0x41B198: miscscrn (root_menu.c:323)
==22619== by 0x41B377: load_screen (root_menu.c:520)
==22619== by 0x41B72A: root_menu (root_menu.c:688)
==22619== by 0x406DFA: main (main.c:196)
==22619== Address 0x0 is not stack'd, malloc'd or (recently) free'd

Question:
Should we protect against "menu->submenus" being NULL or
should the menu system hide empty menus without any items at all?

Cheers,
Thomas
This task depends upon

Comment by Thomas Martitz (kugel.) - Sunday, 13 March 2011, 12:50 GMT+2
Doesn't crash on android. It's just empty.
Comment by Jonathan Gordon (jdgordon) - Sunday, 13 March 2011, 12:53 GMT+2
press ACTION_STD_OK when you are in the empty menu...
Comment by Thomas Martitz (kugel.) - Sunday, 13 March 2011, 12:55 GMT+2
That crashes indeed.

Loading...