Fix possible overflow when using /menu

This commit is contained in:
TingPing 2014-12-11 13:49:37 -05:00
parent d6e3f740bc
commit f614a3c311
1 changed files with 3 additions and 1 deletions

View File

@ -1168,7 +1168,9 @@ menu_is_mainmenu_root (char *path, gint16 *offset)
{
if (!strncmp (path, menus[i] + 1, menus[i][0]))
{
*offset = menus[i][0] + 1; /* number of bytes to offset the root */
*offset = menus[i][0]; /* number of bytes to offset the root */
if (path[*offset] != '\0')
*offset += 1;
return 0; /* is not main menu */
}
}