From 777af2f65e25fcb15db5bc68fa9d0255c001efb2 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Tue, 7 Jul 2015 14:21:31 -0300 Subject: [PATCH] Fix a null pointer dereference bug --- gnu/getopt/Getopt.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/getopt/Getopt.java b/gnu/getopt/Getopt.java index 429301b..04ae13a 100644 --- a/gnu/getopt/Getopt.java +++ b/gnu/getopt/Getopt.java @@ -1228,7 +1228,8 @@ else if (optind == argv.length) optarg = argv[optind]; } - c = checkLongOption(); + if (long_options != null) + c = checkLongOption(); if (longopt_handled) return(c);