--handle-unknown option takes a required argument

Fix a segmentation fault if the --handle-unknown option was set without
arguments.

Thanks to Alexandre Rebert and his team at Carnegie Mellon University
for detecting this crash.
This commit is contained in:
Laurent Bigonville 2013-07-06 14:32:33 +02:00 committed by Stephen Smalley
parent fceca652c1
commit f6a03f1a3c
2 changed files with 2 additions and 2 deletions

View File

@ -171,7 +171,7 @@ int main(int argc, char **argv)
{"output", required_argument, NULL, 'o'},
{"binary", no_argument, NULL, 'b'},
{"version", no_argument, NULL, 'V'},
{"handle-unknown", optional_argument, NULL, 'U'},
{"handle-unknown", required_argument, NULL, 'U'},
{"mls", no_argument, NULL, 'M'},
{NULL, 0, NULL, 0}
};

View File

@ -402,7 +402,7 @@ int main(int argc, char **argv)
{"binary", no_argument, NULL, 'b'},
{"debug", no_argument, NULL, 'd'},
{"version", no_argument, NULL, 'V'},
{"handle-unknown", optional_argument, NULL, 'U'},
{"handle-unknown", required_argument, NULL, 'U'},
{"mls", no_argument, NULL, 'M'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}