diff options
author | TingPing <tingping@tingping.se> | 2014-12-11 13:49:37 -0500 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2014-12-11 13:49:37 -0500 |
commit | f614a3c311f78dceceaa96112a4453746cf622a9 (patch) | |
tree | 7ba871b445a94ee93c2c6bd08650e8af1ef34f19 /src | |
parent | d6e3f740bc93e6bf472d165f5a7c5e8b69be1a8b (diff) |
Fix possible overflow when using /menu
Diffstat (limited to 'src')
-rw-r--r-- | src/common/outbound.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/outbound.c b/src/common/outbound.c index 8d32cf38..8181bd8a 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -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 */ } } |