summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-05-12 18:09:03 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-05-12 18:09:03 +0000
commitb144bf6e8365a2df344f9e99f0b7f2a6f9318513 (patch)
tree9fa7f02823b441538ed8b974738cef418dfa75a1 /sys
parentcc5e29e35735db9dbef34fd248a0e8120c0a040f (diff)
Move bzero() after test for correct allocation (jj@wabbitt.org)
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_ah.c6
-rw-r--r--sys/netinet/ip_esp.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index 3e3f6533e08..505f4051278 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.50 2001/04/14 00:30:58 angelos Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.51 2001/05/12 18:09:02 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -607,7 +607,6 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff)
/* Allocate IPsec-specific opaque crypto info */
MALLOC(tc, struct tdb_crypto *, sizeof(struct tdb_crypto),
M_XDATA, M_NOWAIT);
- bzero(tc, sizeof(struct tdb_crypto));
if (tc == NULL)
{
m_freem(m);
@@ -616,6 +615,7 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff)
ahstat.ahs_crypto++;
return ENOBUFS;
}
+ bzero(tc, sizeof(struct tdb_crypto));
/*
* Save the authenticator, the skipped portion of the packet, and the
@@ -1048,7 +1048,6 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
/* Allocate IPsec-specific opaque crypto info */
MALLOC(tc, struct tdb_crypto *, sizeof(struct tdb_crypto), M_XDATA,
M_NOWAIT);
- bzero(tc, sizeof(struct tdb_crypto));
if (tc == NULL)
{
m_freem(m);
@@ -1057,6 +1056,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
ahstat.ahs_crypto++;
return ENOBUFS;
}
+ bzero(tc, sizeof(struct tdb_crypto));
/* Save the skipped portion of the packet */
MALLOC(tc->tc_ptr, caddr_t, skip, M_XDATA, M_NOWAIT);
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c
index 6d85a401278..421e53652bb 100644
--- a/sys/netinet/ip_esp.c
+++ b/sys/netinet/ip_esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp.c,v 1.56 2001/04/14 00:30:59 angelos Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.57 2001/05/12 18:09:02 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -381,7 +381,6 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff)
/* Get IPsec-specific opaque pointer */
MALLOC(tc, struct tdb_crypto *, sizeof(struct tdb_crypto),
M_XDATA, M_NOWAIT);
- bzero(tc, sizeof(struct tdb_crypto));
if (tc == NULL)
{
m_freem(m);
@@ -390,6 +389,7 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff)
espstat.esps_crypto++;
return ENOBUFS;
}
+ bzero(tc, sizeof(struct tdb_crypto));
if (esph)
{
@@ -948,7 +948,6 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
/* IPsec-specific opaque crypto info */
MALLOC(tc, struct tdb_crypto *, sizeof(struct tdb_crypto),
M_XDATA, M_NOWAIT);
- bzero(tc, sizeof(struct tdb_crypto));
if (tc == NULL)
{
m_freem(m);
@@ -957,6 +956,7 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
espstat.esps_crypto++;
return ENOBUFS;
}
+ bzero(tc, sizeof(struct tdb_crypto));
tc->tc_spi = tdb->tdb_spi;
tc->tc_proto = tdb->tdb_sproto;