aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguy <guy>2002-08-25 21:13:52 +0000
committerguy <guy>2002-08-25 21:13:52 +0000
commitbf2270da5b71fcd774870ba2985008dfc3c3a224 (patch)
tree1b5704698952c3245b362e4544b006d11a40fb4b
parentee9e2f0c05e6c678c8be26f5625a4a97a7c9012b (diff)
From Guillaume Pelat <endymion_@users.sourceforge.net>: properly
null-terminate the interface name when doing an NIOCBIND.
-rw-r--r--CREDITS1
-rw-r--r--pcap-snit.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/CREDITS b/CREDITS
index 228f979..255f5d6 100644
--- a/CREDITS
+++ b/CREDITS
@@ -26,6 +26,7 @@ Additional people who have contributed patches:
Graeme Hewson <ghewson@cix.compulink.co.uk>
Greg Stark <gsstark@mit.edu>
Greg Troxel <gdt@ir.bbn.com>
+ Guillaume Pelat <endymion_@users.sourceforge.net>
Hyung Sik Yoon <hsyn@kr.ibm.com>
Igor Khristophorov <igor@atdot.org>
Jan-Philip Velders <jpv@veldersjes.net>
diff --git a/pcap-snit.c b/pcap-snit.c
index 63c810b..359c4ad 100644
--- a/pcap-snit.c
+++ b/pcap-snit.c
@@ -25,7 +25,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.57 2002-07-11 09:06:43 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.58 2002-08-25 21:13:52 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -272,7 +272,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
/* request the interface */
strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
- ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = ' ';
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
si.ic_cmd = NIOCBIND;
si.ic_len = sizeof(ifr);
si.ic_dp = (char *)&ifr;