From 8d972d5f4431f9fc4a585ff3e7a59438cca663fe Mon Sep 17 00:00:00 2001 From: Gabriel VLASIU Date: Thu, 4 Apr 2013 18:43:30 +0300 Subject: [PATCH] wmbiff: Fix segfault when -display or -geometry argument is missing. --- wmbiff/wmgeneral/wmgeneral.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wmbiff/wmgeneral/wmgeneral.c b/wmbiff/wmgeneral/wmgeneral.c index cb0fd6d..dc06cb6 100644 --- a/wmbiff/wmgeneral/wmgeneral.c +++ b/wmbiff/wmgeneral/wmgeneral.c @@ -475,11 +475,11 @@ void openXwindow(int argc, const char *argv[], } for (i = 1; argv[i]; i++) { - if (!strcmp(argv[i], "-display")) { + if (!strcmp(argv[i], "-display") && i < argc - 1) { display_name = argv[i + 1]; i++; } - if (!strcmp(argv[i], "-geometry")) { + if (!strcmp(argv[i], "-geometry") && i < argc - 1) { geometry = argv[i + 1]; i++; }