[PATCH] unshare: fix SIGSEGV on invalid command line option

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

 



$ unshare --hel
Segmentation fault

The last element of longopts has to be filled with zeros.

Signed-off-by: Kirill A. Shutemov <kirill@xxxxxxxxxxxxx>
---
 sys-utils/unshare.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c
index 6b6177c..12a725e 100644
--- a/sys-utils/unshare.c
+++ b/sys-utils/unshare.c
@@ -76,6 +76,7 @@ int main(int argc, char *argv[])
 		{ "uts", no_argument, 0, 'u' },
 		{ "ipc", no_argument, 0, 'i' },
 		{ "net", no_argument, 0, 'n' },
+		{ NULL, 0, 0, 0 }
 	};
 
 	int unshare_flags = 0;
-- 
1.7.3.4


--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux