Code

Added check for two arguments. Was segfaulting if no or one arg. Now returns
authorHarper Mann <harpermann@users.sourceforge.net>
Fri, 7 Jul 2006 06:36:03 +0000 (06:36 +0000)
committerHarper Mann <harpermann@users.sourceforge.net>
Fri, 7 Jul 2006 06:36:03 +0000 (06:36 +0000)
help.

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1444 f882894a-f735-0410-b71e-b25c423dba1c

plugins/urlize.c

index d4d00dd6e99c9817732eeecffef410f20c726b70..5bff4b2f8a018ed2fd3974737a281349a4ec0782 100644 (file)
@@ -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);