From 19a8ebc05eeba8180b356bb2d0a74e90288fefac Mon Sep 17 00:00:00 2001
From: Christophe CURIS <[email protected]>
Date: Tue, 17 Jul 2012 23:43:37 +0200
Subject: [PATCH 1/3] Menu parser: fix possible infinite loop when loading
 menu file

When a #include is used, the file is searched in many places; when
the file was searched in the ':'-separated list of path it could
led to infinite loop if the list contained more than one path and
that the file was not found in the first path, the ':' separator
was not properly passed over.
---
 WINGs/menuparser.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/WINGs/menuparser.c b/WINGs/menuparser.c
index 96555cd..b196a00 100644
--- a/WINGs/menuparser.c
+++ b/WINGs/menuparser.c
@@ -493,6 +493,9 @@ static Bool menu_parser_include_file(WMenuParser parser)
 
 				fh = fopen(fullfilename, "rb");
 				if (fh != NULL) goto found_valid_file;
+
+				if (*src == ':')
+					src++;
 			}
 		}
 		WMenuParserError(parser, _("could not find file \"%s\" for include"), req_filename);
-- 
1.7.10.4

Reply via email to