[Devel] [PATCH] arpsend: Fix segfault when parsing long options

Dmitry V. Levin ldv at altlinux.org
Thu Aug 24 14:51:50 PDT 2006


arpsend: parse_options(): NULL-terminate long_options array.

Signed-off-by: Dmitry V. Levin <ldv at altlinux.org>
---
 src/arpsend.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/arpsend.c b/src/arpsend.c
index 2fe1226..7e1e032 100644
--- a/src/arpsend.c
+++ b/src/arpsend.c
@@ -165,7 +165,8 @@ #define read_ip(addr)					\
 		{"trg-arp", 1, NULL, 'T'},
 		{"src-ip", 1, NULL, 'i'},
 		{"trg-ip", 1, NULL, 'e'},
-		{"at-once", 0, NULL, 'o'}
+		{"at-once", 0, NULL, 'o'},
+		{ NULL, 0, NULL, 0 }
 	};
 
 	while ((c = getopt_long(argc, argv, short_options, long_options, NULL)) != -1)
-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20060825/c352f522/attachment-0001.sig>


More information about the Devel mailing list