summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2014-12-11 13:49:37 -0500
committerTingPing <tingping@tingping.se>2014-12-11 13:49:37 -0500
commitf614a3c311f78dceceaa96112a4453746cf622a9 (patch)
tree7ba871b445a94ee93c2c6bd08650e8af1ef34f19 /src/common
parentd6e3f740bc93e6bf472d165f5a7c5e8b69be1a8b (diff)
Fix possible overflow when using /menu
Diffstat (limited to 'src/common')
-rw-r--r--src/common/outbound.c4
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 */
 		}
 	}