mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-12 06:32:34 -05:00
mikmod: Fix null pointer dereference in mikmod plugin
While playing, the user can switch between status/samples/instruments/comments screens. The instrument names are blindly passed to printf, which will lead to a null pointer dereference if the instrument name is NULL. ...Which happens with some .IT modules that I have. This should arguably be fixed in the printf implementation, but we still shouldn't be passing in NULLs as string arguments! Change-Id: I2899e2f7e10565c251e495752b3ef1bbccea82c7
This commit is contained in:
parent
4d0d41a0f4
commit
53a43522a3
1 changed files with 1 additions and 1 deletions
|
|
@ -378,7 +378,7 @@ static void showinstruments(void)
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
for( i=0; i<MAX_LINES && i+vscroll<module->numins; i++ )
|
for( i=0; i<MAX_LINES && i+vscroll<module->numins; i++ )
|
||||||
{
|
{
|
||||||
sprintf(statustext, "%02d %s", i+vscroll+1, module->instruments[i+vscroll].insname);
|
sprintf(statustext, "%02d %s", i+vscroll+1, module->instruments[i+vscroll].insname ? module->instruments[i+vscroll].insname : "[n/a]");
|
||||||
rb->lcd_putsxy(1, 1+(8*i), statustext);
|
rb->lcd_putsxy(1, 1+(8*i), statustext);
|
||||||
}
|
}
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue