summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-03-05 12:08:44 +0000
committerbde <bde@FreeBSD.org>1997-03-05 12:08:44 +0000
commit20c91658b48454fc7554c126e6eed9f081b6a2d6 (patch)
tree5f7512362a02e1275cab1345d3bac13cb0e046ea /sbin/ipfw
parent8f4ea9b77677e120f9483560c4ca8faadad8357f (diff)
downloadFreeBSD-src-20c91658b48454fc7554c126e6eed9f081b6a2d6.zip
FreeBSD-src-20c91658b48454fc7554c126e6eed9f081b6a2d6.tar.gz
Force null termination after 2 errant strncpy()s.
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c
index 4a85719..e321a8b 100644
--- a/sbin/ipfw/ipfw.c
+++ b/sbin/ipfw/ipfw.c
@@ -16,7 +16,7 @@
*
* NEW command line interface for IP firewall facility
*
- * $Id$
+ * $Id: ipfw.c,v 1.40 1997/02/22 14:32:36 peter Exp $
*
*/
@@ -739,6 +739,7 @@ add(ac,av)
char *q;
strncpy(rule.fw_via_name, *av, sizeof(rule.fw_via_name));
+ rule.fw_via_name[sizeof(rule.fw_via_name) - 1] = '\0';
for (q = rule.fw_via_name; *q && !isdigit(*q) && *q != '*'; q++)
continue;
if (*q == '*')
@@ -942,6 +943,7 @@ main(ac, av)
FILE *f;
strncpy(progname,*av, sizeof(progname));
+ progname[sizeof(progname) - 1] = '\0';
s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW );
if ( s < 0 ) {
OpenPOWER on IntegriCloud