From f6f9719d77e16be22cc895846d5a194bedc0a06c Mon Sep 17 00:00:00 2001 From: Kjell Wooding Date: Thu, 10 Aug 2000 05:50:28 +0000 Subject: Import ipf 3.3.18. Fixes more problems with the in-kernel FTP proxy, some nat state bugs, and ups the default state table size. See sbin/ipf/HISTORY for details. --- sys/netinet/ip_fil.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'sys/netinet/ip_fil.c') diff --git a/sys/netinet/ip_fil.c b/sys/netinet/ip_fil.c index 5f5cb113d24..b8243712c19 100644 --- a/sys/netinet/ip_fil.c +++ b/sys/netinet/ip_fil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_fil.c,v 1.35 2000/05/24 21:59:11 kjell Exp $ */ +/* $OpenBSD: ip_fil.c,v 1.36 2000/08/10 05:50:25 kjell Exp $ */ /* * Copyright (C) 1993-1998 by Darren Reed. @@ -9,7 +9,7 @@ */ #if !defined(lint) static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-1995 Darren Reed"; -static const char rcsid[] = "@(#)$IPFilter: ip_fil.c,v 2.4.2.21 2000/05/22 06:57:47 darrenr Exp $"; +static const char rcsid[] = "@(#)$IPFilter: ip_fil.c,v 2.4.2.22 2000/07/08 02:43:47 darrenr Exp $"; #endif #ifndef SOLARIS @@ -1401,15 +1401,29 @@ char *name; if (!ifneta) { ifneta = (struct ifnet **)malloc(sizeof(ifp) * 2); + if (!ifneta) + return NULL; ifneta[1] = NULL; ifneta[0] = (struct ifnet *)calloc(1, sizeof(*ifp)); + if (!ifneta[0]) { + free(ifneta); + return NULL; + } nifs = 1; } else { nifs++; ifneta = (struct ifnet **)realloc(ifneta, (nifs + 1) * sizeof(*ifa)); + if (!ifneta) { + nifs = 0; + return NULL; + } ifneta[nifs] = NULL; ifneta[nifs - 1] = (struct ifnet *)malloc(sizeof(*ifp)); + if (!ifneta[nifs - 1]) { + nifs--; + return NULL; + } } ifp = ifneta[nifs - 1]; -- cgit v1.2.3