[PATCH] --handle-unknown option takes a required argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Laurent Bigonville <bigon@xxxxxxxx>

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.
---
 checkpolicy/checkmodule.c | 2 +-
 checkpolicy/checkpolicy.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/checkpolicy/checkmodule.c b/checkpolicy/checkmodule.c
index cb58cf0..41ebab5 100644
--- a/checkpolicy/checkmodule.c
+++ b/checkpolicy/checkmodule.c
@@ -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}
 	};
diff --git a/checkpolicy/checkpolicy.c b/checkpolicy/checkpolicy.c
index 544f235..292f568 100644
--- a/checkpolicy/checkpolicy.c
+++ b/checkpolicy/checkpolicy.c
@@ -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}
-- 
1.8.3.2


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux