1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-25 18:52:22 -05:00

Fix possible overflow when using /menu

This commit is contained in:
TingPing 2014-12-11 13:49:37 -05:00
parent d6e3f740bc
commit f614a3c311

View File

@ -1168,7 +1168,9 @@ menu_is_mainmenu_root (char *path, gint16 *offset)
{ {
if (!strncmp (path, menus[i] + 1, menus[i][0])) 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 */ return 0; /* is not main menu */
} }
} }