segfault in wmmenugen

Nolan Eakins <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <CA+ESikn99D6TJOZXNkFbqAzX8C1kjyy02YS2sW6SnU-Fho36Lg@mail.gmail.com>
Hey WindowMaker team! Long time user, first time patcher?

Here's a small patch that fixes a segfault I noticed in wmmenugen when I
tried it on a Raspberry Pi 2. Basically argv was overran with "<= argc".

Regards,
Nolan Eakins
0001-argc-was-overrun-crashing-on-my-Pi.patch (text/x-patch, 717 B)
From 09c6cc2331d9c831a4027d34d2e75d3f84c6855b Mon Sep 17 00:00:00 2001
From: Nolan Eakins <[email protected]>
Date: Thu, 25 Feb 2016 01:09:43 -0500
Subject: [PATCH] argc was overrun crashing on my Pi.

---
 util/wmmenugen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/wmmenugen.c b/util/wmmenugen.c
index 5839189..47e89f7 100644
--- a/util/wmmenugen.c
+++ b/util/wmmenugen.c
@@ -106,7 +106,7 @@ int main(int argc, char **argv)
 	parse_locale(NULL, &env_lang, &env_ctry, &env_enc, &env_mod);
 	terminal = find_terminal_emulator();
 
-	for (i = 1; i <= argc; i++)
+	for (i = 1; i < argc; i++)
 	{
 		if (strncmp(argv[i], "-parser", 7) == 0 &&
 		    (argv[i][7] == '=' ||
-- 
2.4.10
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.