From 3b9386244655be4ef16729ffad4c1f1171af7262 Mon Sep 17 00:00:00 2001 From: Harper Mann Date: Fri, 7 Jul 2006 06:36:03 +0000 Subject: [PATCH] Added check for two arguments. Was segfaulting if no or one arg. Now returns help. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1444 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/urlize.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/urlize.c b/plugins/urlize.c index d4d00dd..5bff4b2 100644 --- a/plugins/urlize.c +++ b/plugins/urlize.c @@ -56,6 +56,12 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + /* Need at least 2 args */ + if (argc < 3) { + print_help(); + exit (STATE_UNKNOWN); + } + while (1) { c = getopt_long (argc, argv, "+hVu:", longopts, &option); -- 2.30.2