From f614a3c311f78dceceaa96112a4453746cf622a9 Mon Sep 17 00:00:00 2001 From: TingPing Date: Thu, 11 Dec 2014 13:49:37 -0500 Subject: [PATCH] Fix possible overflow when using /menu --- src/common/outbound.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 */ } }